Just open Google try to type following queries
Wednesday, March 7, 2012
Google can tell you that what the world want? Really!
Just open Google try to type following queries
Sunday, March 4, 2012
Microsoft has released Visual-Studio 2011 beta and Window 8 Consumer preview
Visual Studio 2011 Beta
Jason Zander has first announced regarding release of Visual Studio 11 Beta & .NET 4.5 Beta on his blog post.
Download it from here + Download Visual Studio 2011 Beta
This time Visual Studio lunched with totally new look combine with many new feathers as below.
- Project Compatibility
- IDE Productivity Improvements
- Search Everywhere
- Toolbar Improvements
- Additional Tooling
- Multiple-Monitor Support
- Performance Enhancements
- New Project Types
- Extensibility
You can read each & every fether on Visual studio magazine's post about "Inside Visual Studio 11: A Guided Tour".
Scott Hanselman has also written about overview of features available with Visual Studio 2011 beta in his blog post.
Window-8 Consumer Preview
Steven Sinofsky has first made announcement on his blog post of "Windows 8 – The Consumer Preview" availability for download.if you are in hurry to look inside it then visit this and starting now at http://preview.windows.com.
Read this guidelines before installation
- How To Guide to Installing and Booting Windows 8 Consumer Preview off a VHD by Scott Hanselman
- Windows 8 Installation Guides by Amit Agrawal.
There are lots of post (i think many people rushed out to write about that to be a first blogger to write on this topic!) available on internet about Window 8 features so i don't want to talk about it here.
just google it - Window 8 features :)
Saturday, March 3, 2012
ASP.NET Web API - Great collection of learning resources
I was also searching for that and found good links here with all tutorials, videos and samples.
Tugberk Ugurlu lists a bunch of great resources for getting started with ASP.NET Web API in his blog post, follow below link.
Thursday, March 1, 2012
REST call using json in asp.net with Basic authentication
Today many service provided as restful web service which can easily accessed by any browser on any system with any language.
I would like to give you Example with code here to make post call using json data in asp.net.
we need to add below namespcae for that
- using System.Net;
- using System.IO;
WebResponse: Responsible to provide response from URI
WebRequest: Responsible to make request to URI
In above code i made request with basic authentication (In my words: if you'll request service URI with browser and if it will prompt with login box then that service requires basic authentication to access resources ) and try to get response.
you can test your rest call using Fiddler as well before implementation of code to test that web service working is as per expectation.
Important Note :
As per stackoverflow's answer take care about this header Expect: 100-Continue.
"By default, .NET will tag outgoing POST requests with the header Expect: 100-Continue. If the server doesn't support this, it will fail with a 417 error.
To get .NET to not do this, execute the following before creating your WebRequest object:
System.Net.ServicePointManager.Expect100Continue = false;
"
Hope it will be helpful to you!
Extend the built-in ASP.NET DataAnnotations using DataAnnotations Extensions
DataAnnotations contains mostly Required, Range, RegularExpression and StringLength and to see full list of attributes it contains visit this msdn link "Using Data Annotations to Customize Data Classes" .
In my mvc application there is person class (Model) and validation for email as per below (by regular expression)
Scott Kirkland has extended this and created excellent DataAnnotations Extensions pacakge for .net to allow more validation attributes, also he has explained about this in his blog post with examples.
so after installing DataAnnotations Extensions Nuget package i can write email validation as per below
Following are list of more validation attributes available in DataAnnotations Extensions
- CreditCardAttribute
- CuitAttribute
- DateAttribute
- DigitsAttribute
- EmailAttribute
- EqualToAttribute
- FileExtensionsAttribute
- IntegerAttribute
- MaxAttribute
- MinAttribute
- NumericAttribute
- UrlAttribute
- YearAttribute
