Friday, March 30, 2012

Microsoft announced ASP.NET MVC,web API and Razor as Open Source

0 comments
I have read today scottgu's blog entry about announcement of release the source code of ASP.NET MVC, Web API, and Razor under an open source license (Apache 2.0).
Now you can download source code from codeplex and if you want contribute in that then you can do it there.
Hope that making it open source will improve ASP.NET MVC, Web API, and Razor to better level because now it is open to every people. (Power of Open Source!)

Read more about this

Wednesday, March 14, 2012

Have you checked Meta Tags of your website or blog?

0 comments
If you are running your blog or website then it is important to know about Meta Tags.

Meta Tags provide information of your website/blog to search engine like google, bing, yahoo for how to display your website or blog to their search engine.

look at this link what is Meta tags? by W3schools.

Let's take case study of my blog, before putting meta data my blog display in google search result as per below.



then i came across google webmaster link about meta data they are using for crawling and add some of Meta tags for my blog and after one day google has change descrption as per my meta data as per below. (you can type my name "arun rana" to google to see in live)



You can also control of your web pages from displaying in google search by below meta tag.
<META NAME="robots" CONTENT="noindex,nofollow">

After putting Meta data if you want to test your site/blog for meta data then there is very good tool available online  called Meta Tag Analyzer which will give you very deep research and review of meta data.

Useful Reading about Meta Tags



Wednesday, March 7, 2012

Google can tell you that what the world want? Really!

0 comments
I was so boring in night yesterday and playing with Google and found some interesting queries you want to google it! it can really tell you what is people requirement all over the world (you can make profit if you are businessman!)

Just open Google try to type following queries

Sunday, March 4, 2012

Microsoft has released Visual-Studio 2011 beta and Window 8 Consumer preview

0 comments
Microsoft has released 2 great new version of it's products which includes visual stuido 2011 beta which is development environment (IDE) for .net programmer and new version of OS Window8-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

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

0 comments
ASP.NET team launched MVC4 Beta with new asp.net web API template and all .net peoples looking for good resources to learn more about that and build application on that.

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

0 comments
REST (Representational state transfer) is very popular architecture to transfer resource on web. Using HTTP methods (GET, PUT, POST, DELETE),the Internet media type of the data supported by the web service(JSON, XML or YAM etc.) and principles of REST we can build RESTful web service.
 
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

0 comments
If you have worked with development of web service, silverlight application or mvc applicaiton then you know about DataAnnotations class to validate DTO client side as well as server side.

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
You can see demo of each & every attributes here.