<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;DE4DQH48fSp7ImA9WhRbFUU.&quot;"><id>tag:blogger.com,1999:blog-7819331473560289523</id><updated>2012-02-07T09:26:11.075+05:30</updated><category term="node.js" /><category term="ASP .NET MVC" /><category term="iisnode" /><category term="Visual Studio" /><category term="URL Rewrite" /><category term="Book Review" /><category term="IIS 7" /><category term="jQuery" /><category term="MVC" /><category term="Fundamental" /><category term="SQL" /><category term="C-Sharp" /><category term="ASP .NET" /><category term="Review" /><category term="jQuery Mobile" /><category term="CTP" /><category term="IIS" /><category term="MVC 4" /><category term="C#" /><category term="Wait Stats" /><category term="Roslyn" /><category term="SEO" /><category term="ASP .NET 4.5" /><category term="vNext" /><category term="Remote IIS" /><title>dotnetExpertGuide.com</title><subtitle type="html" /><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://www.dotnetexpertguide.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://www.dotnetexpertguide.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Nandip Makwana</name><uri>https://profiles.google.com/100983452498554383356</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-pDb4IK6WZRs/AAAAAAAAAAI/AAAAAAAAAf4/0K7LrsiXehI/s512-c/photo.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>48</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/Dotnetexpertguide" /><feedburner:info uri="dotnetexpertguide" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>Dotnetexpertguide</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><entry gd:etag="W/&quot;CUYFQnw7cSp7ImA9WhRVGE8.&quot;"><id>tag:blogger.com,1999:blog-7819331473560289523.post-2252536884116577044</id><published>2012-01-17T07:57:00.000+05:30</published><updated>2012-01-17T23:28:33.209+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-17T23:28:33.209+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MVC" /><category scheme="http://www.blogger.com/atom/ns#" term="ASP .NET MVC" /><title>Dividing ASP.NET MVC Components in Separate Projects</title><content type="html">&lt;p&gt;Whenever we create new ASP.NET MVC 3 project, it follow pre defined directory convention and adds few files and directory to the project. However it is not compulsory to follow this default directory structure, but it help us to keep application clean &amp; maintainable by grouping application component based on functionality i.e. controller, model, view etc. But when it comes to large project, it is very hard to maintain all components in one project. &lt;/p&gt; 
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-rY1Alfz0CkY/TxTTFb5BeDI/AAAAAAAAAiY/-tbgt1LQxSs/s1600/1%2Bmvc%2B3%2Bdirectory.png" imageanchor="1" style="clear: left; float: right; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://1.bp.blogspot.com/-rY1Alfz0CkY/TxTTFb5BeDI/AAAAAAAAAiY/-tbgt1LQxSs/s320/1%2Bmvc%2B3%2Bdirectory.png" width="197" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;In such scenario, it is advisable to divide different components in different library projects. i.e. all model classes goes in separate library project, all controller goes in another library project and so on. Apart from model, and controller, it is also advisable to encapsulate business logic in separate library project rather than placing it in controller. By this way we can reuse business logic to expose additional services for e.g. it may happen application also provide API for third party integration. In this case we can reuse business logic to build API services because generally business logic remain same regardless of consumer (here web portal or API services). &lt;/p&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-Xs2-Lq2xzFc/TxTTFkdBy_I/AAAAAAAAAik/uueCpZ8TWQI/s1600/2%2BMVC%2BApp.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="195" src="http://2.bp.blogspot.com/-Xs2-Lq2xzFc/TxTTFkdBy_I/AAAAAAAAAik/uueCpZ8TWQI/s320/2%2BMVC%2BApp.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;So here we will see how we can divide model, controller, and view in separate project. Once we done with dividing MVC component in different project, it is quite easier to encapsulate business logic in separate project. &lt;/p&gt;
&lt;p&gt;To get started, create blank solution in Visual Studio and add one library project to it. Let give it name &lt;b&gt;ModelLib&lt;/b&gt;. We need to add reference to Entity Framework as ModelLib is responsible to deal with data source. To add reference of Entity Framework via NuGet type following in Package Manager Console in Visual Studio. &lt;/p&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-ThH82lQioD8/TxTTF7XEh4I/AAAAAAAAAis/-upXRzdolU0/s1600/3%2Bentity%2Bframework.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-ThH82lQioD8/TxTTF7XEh4I/AAAAAAAAAis/-upXRzdolU0/s1600/3%2Bentity%2Bframework.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;Now we can add model classes in this project. So far we have done successfully but it may require that we need to add more references to the project as and when it is needed. For e.g. reference to System.ComponentModel.DataAnnotations to use Data Annotations Attribute to validate property or field of model. &lt;/p&gt;
&lt;p&gt;Now add one more class library project named &lt;b&gt;ControllerLib&lt;/b&gt; and add following references to the project. &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Entity Framework&lt;/li&gt;
&lt;li&gt;ASP.NET MVC 3 assembly which is by default installed at &lt;b&gt;C:\Program Files\Microsoft ASP.NET\ASP.NET MVC 3\Assemblies&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;ModelLib project&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Now we can create new controller within this project as we were creating it with default project template by inheriting class from &lt;b&gt;System.Web.Mvc.Controller&lt;/b&gt; and use the same naming convention i.e. &lt;b&gt;&lt;i&gt;Name&lt;/i&gt;Controller.cs&lt;/b&gt; where name is replaced with controller name. &lt;/p&gt;
&lt;p&gt;&lt;b&gt;NOTE:&lt;/b&gt; While adding new model or controller classes, verify that its access modifier is public. Because here model and controller classes are placed in different assembly and might be in different namespace also. &lt;/p&gt;
&lt;p&gt;So far we are ready with controller and model classes, now its turn to build views. To build view, add empty MVC 3 project template (or we can even use Phil Haack’s &lt;a href="http://haacked.com/archive/2012/01/11/a-really-empty-asp-net-mvc-3-project-template.aspx" target="_blank"&gt;Really Empty MVC 3 template&lt;/a&gt;) and add references to the ControllerLib project. Now we are just one step away to finish! Now we can add view as we were adding it in default project template within sub directory of view directory.&lt;/p&gt;
&lt;p&gt;To run application set MVC 3 project, which we added in last, as a startup project and run by pressing F5. &lt;/p&gt;
&lt;p&gt;One great thing is that in this pattern also Add View dialog populate with model classes from ModelLib project as displayed in below image so we can even create strongly typed view based on model!! &lt;/p&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-Ex9teqysELA/TxTTF3OITjI/AAAAAAAAAi8/s4o_ugqpgjQ/s1600/4%2Badd%2Bview.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-Ex9teqysELA/TxTTF3OITjI/AAAAAAAAAi8/s4o_ugqpgjQ/s1600/4%2Badd%2Bview.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;Sample project can be downloaded from &lt;a href="http://files.dotnetexpertguide.com/download.aspx?key=MVCComponents"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Hope this would be helpful. You can follow me &lt;a href="http://twitter.com/nandipmakwana" target="_blank"&gt;@NandipMakwana&lt;/a&gt; to get latest update via twitter. &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7819331473560289523-2252536884116577044?l=www.dotnetexpertguide.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/CXcza46GfEPSAvFHw4_0X3QySK4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/CXcza46GfEPSAvFHw4_0X3QySK4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/CXcza46GfEPSAvFHw4_0X3QySK4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/CXcza46GfEPSAvFHw4_0X3QySK4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=bqQRtt6JqjU:9DvUHyvVbi4:iuKBeV4sXr0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=bqQRtt6JqjU:9DvUHyvVbi4:iuKBeV4sXr0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=bqQRtt6JqjU:9DvUHyvVbi4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=bqQRtt6JqjU:9DvUHyvVbi4:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=bqQRtt6JqjU:9DvUHyvVbi4:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=bqQRtt6JqjU:9DvUHyvVbi4:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=bqQRtt6JqjU:9DvUHyvVbi4:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=bqQRtt6JqjU:9DvUHyvVbi4:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=bqQRtt6JqjU:9DvUHyvVbi4:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Dotnetexpertguide/~4/bqQRtt6JqjU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.dotnetexpertguide.com/feeds/2252536884116577044/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.dotnetexpertguide.com/2012/01/dividing-mvc-components-in-separate.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/2252536884116577044?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/2252536884116577044?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Dotnetexpertguide/~3/bqQRtt6JqjU/dividing-mvc-components-in-separate.html" title="Dividing ASP.NET MVC Components in Separate Projects" /><author><name>Nandip Makwana</name><uri>https://profiles.google.com/100983452498554383356</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-pDb4IK6WZRs/AAAAAAAAAAI/AAAAAAAAAf4/0K7LrsiXehI/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-rY1Alfz0CkY/TxTTFb5BeDI/AAAAAAAAAiY/-tbgt1LQxSs/s72-c/1%2Bmvc%2B3%2Bdirectory.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.dotnetexpertguide.com/2012/01/dividing-mvc-components-in-separate.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk4ESHsycCp7ImA9WhRVEko.&quot;"><id>tag:blogger.com,1999:blog-7819331473560289523.post-6478548905567056066</id><published>2012-01-11T09:12:00.000+05:30</published><updated>2012-01-11T15:11:49.598+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-11T15:11:49.598+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="node.js" /><category scheme="http://www.blogger.com/atom/ns#" term="IIS" /><category scheme="http://www.blogger.com/atom/ns#" term="iisnode" /><category scheme="http://www.blogger.com/atom/ns#" term="IIS 7" /><title>Installing and Running node.js application with iisnode</title><content type="html">&lt;p&gt;Over a last few days, all are talking about asynchronous programming especially &lt;a href="http://nodejs.org/" target="_blank"&gt;node.js&lt;/a&gt; and signalr. Microsoft also included AsyncCTP within ASP.NET 4.5. But it seems node.js and SignalR is winning the race. Anyway we are not going to compare AsyncCTP with node.js or SignalR. In this post we will see how to install and run node.js in IIS 7 with &lt;a href="https://github.com/tjanczuk/iisnode" target="_blank"&gt;iisnode&lt;/a&gt;.&lt;/p&gt;
&lt;h4&gt;Get IIS ready to run node.Js application&lt;/h4&gt;
&lt;p&gt;To run node.js application under IIS, we need to install node.js engine on server which can be download from &lt;a href="http://www.nodejs.org/#download" target="_blank"&gt;http://www.nodejs.org/#download&lt;/a&gt;. Installing node.js engine will enable us to run node.js application on windows server. But still we require configuring IIS so it can route .js requests to the node.js engine. This can be easily done with the help of iisnode module for IIS 7.x. Once we install iisnode module, we can configure web.config file to route .js or particular file to iisnode module. Iisnode module can be downloaded from &lt;a href="https://github.com/tjanczuk/iisnode/archives/master" target="_blank"&gt;https://github.com/tjanczuk/iisnode/archives/master&lt;/a&gt; once you install iisnode, you will able to find iisnode module in IIS Manager under modules.&lt;/p&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-iZm6A7-WeAI/Tw0BpEDdzRI/AAAAAAAAAho/404TzFoiSNI/s1600/iisnode.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-iZm6A7-WeAI/Tw0BpEDdzRI/AAAAAAAAAho/404TzFoiSNI/s1600/iisnode.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;Iisnode will also install sample application to get started with node.js. Sample application is copied within iisnode installation directory. If you installed iisnode with default settings, then sample can be found in &lt;b&gt;C:\Program Files\iisnode\www&lt;/b&gt; directory. To run this sample application, create new application within default website for e.g. let say &lt;b&gt;nodejsapp&lt;/b&gt; which points to sample application directory mentioned above. Now go to &lt;a href="http://localhost/nodejsapp/"&gt;http://localhost/nodejsapp/&lt;/a&gt; and you should able to see different sample link on your browser.&lt;/p&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-WF7mvv6QnMI/Tw0Bpcic-MI/AAAAAAAAAhw/ZQC2iMKWUi4/s1600/node%2Bjs%2B1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-WF7mvv6QnMI/Tw0Bpcic-MI/AAAAAAAAAhw/ZQC2iMKWUi4/s1600/node%2Bjs%2B1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;Now let examine HelloWorld sample. Go to &lt;a href="http://localhost/nodejsapp/helloworld/hello.js"&gt;http://localhost/nodejsapp/helloworld/hello.js&lt;/a&gt; to run server side JavaScript with the help of node.js engine.&lt;/p&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-VfynVbExmFc/Tw0Bpm6vNVI/AAAAAAAAAh8/aiw59tuOW78/s1600/node%2Bjs%2B2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-VfynVbExmFc/Tw0Bpm6vNVI/AAAAAAAAAh8/aiw59tuOW78/s1600/node%2Bjs%2B2.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;Ohhh!! It looks there are some issue with application pool write permission.  Scott Hanselman already posted issue &lt;a href="https://github.com/tjanczuk/iisnode/issues/28" target="_blank"&gt;here&lt;/a&gt;.
There are two temporary workaround to deal with this permission issue. One is disable logging by adding following key in web.config.&lt;/p&gt;
&lt;script class="brush: html" type="syntaxhighlighter"&gt;
&lt;![CDATA[
&lt;system.webServer&gt;
  &lt;iisnode loggingEnabled="false" /&gt;
&lt;/system.webServer&gt;
]]&gt;
&lt;/script&gt;
&lt;p&gt;Another one is create one application pool with identity as LocalSystem and assign that application pool to the nodejsapp application.&lt;/p&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-aSz-gRGSRKY/Tw0Bp_kEdkI/AAAAAAAAAiQ/nio9KerOhXk/s1600/node%2Bjs%2B3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-aSz-gRGSRKY/Tw0Bp_kEdkI/AAAAAAAAAiQ/nio9KerOhXk/s1600/node%2Bjs%2B3.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;Now you should able to run node.js sample shipped with iisnode.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7819331473560289523-6478548905567056066?l=www.dotnetexpertguide.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/KS_5o_9IWNTt9Tt1NWyul5wgFWo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KS_5o_9IWNTt9Tt1NWyul5wgFWo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/KS_5o_9IWNTt9Tt1NWyul5wgFWo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KS_5o_9IWNTt9Tt1NWyul5wgFWo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=6qm_u-IGwtQ:jMKLNJSat_g:iuKBeV4sXr0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=6qm_u-IGwtQ:jMKLNJSat_g:iuKBeV4sXr0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=6qm_u-IGwtQ:jMKLNJSat_g:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=6qm_u-IGwtQ:jMKLNJSat_g:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=6qm_u-IGwtQ:jMKLNJSat_g:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=6qm_u-IGwtQ:jMKLNJSat_g:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=6qm_u-IGwtQ:jMKLNJSat_g:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=6qm_u-IGwtQ:jMKLNJSat_g:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=6qm_u-IGwtQ:jMKLNJSat_g:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Dotnetexpertguide/~4/6qm_u-IGwtQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.dotnetexpertguide.com/feeds/6478548905567056066/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.dotnetexpertguide.com/2012/01/installing-and-running-nodejs-iisnode.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/6478548905567056066?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/6478548905567056066?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Dotnetexpertguide/~3/6qm_u-IGwtQ/installing-and-running-nodejs-iisnode.html" title="Installing and Running node.js application with iisnode" /><author><name>Nandip Makwana</name><uri>https://profiles.google.com/100983452498554383356</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-pDb4IK6WZRs/AAAAAAAAAAI/AAAAAAAAAf4/0K7LrsiXehI/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-iZm6A7-WeAI/Tw0BpEDdzRI/AAAAAAAAAho/404TzFoiSNI/s72-c/iisnode.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.dotnetexpertguide.com/2012/01/installing-and-running-nodejs-iisnode.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0MNQHc8eSp7ImA9WhRXGUg.&quot;"><id>tag:blogger.com,1999:blog-7819331473560289523.post-6669586393914508412</id><published>2011-12-25T21:52:00.000+05:30</published><updated>2011-12-27T07:34:51.971+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-27T07:34:51.971+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="vNext" /><category scheme="http://www.blogger.com/atom/ns#" term="MVC" /><category scheme="http://www.blogger.com/atom/ns#" term="MVC 4" /><category scheme="http://www.blogger.com/atom/ns#" term="ASP .NET 4.5" /><title>ASP.NET 4.5 : Issue With CssMinify And Workaround For It</title><content type="html">&lt;p&gt;Before 2-3 days, while I was &lt;a href="http://www.dotnetexpertguide.com/2011/12/bundling-and-minification-aspnet-mvc4.html"&gt;examining Bundling and Minification in ASP.NET 4.5&lt;/a&gt;. I observed problem with CSS3 minification while using default bundling which is available with Microsoft.Web.Optimization. Exploring more on it I found that there is a bug in CSS3 minification (while using nested parentheses) and it is already logged at&lt;/p&gt;
&lt;p&gt;&lt;a href="http://connect.microsoft.com/VisualStudio/feedback/details/696436/microsoft-web-optimization-cannot-compress-css3-animations" target="_blank"&gt;http://connect.microsoft.com/VisualStudio/feedback/details/696436/microsoft-web-optimization-cannot-compress-css3-animations&lt;/a&gt;&lt;br/&gt;
and&lt;br/&gt;
&lt;a href="http://connect.microsoft.com/VisualStudio/feedback/details/689523/bugs-in-microsoft-web-optimization" target="_blank"&gt;http://connect.microsoft.com/VisualStudio/feedback/details/689523/bugs-in-microsoft-web-optimization&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Later I thought that why not &lt;a href="http://www.dotnetexpertguide.com/2011/12/custom-transformtype-bundling.html"&gt;create custom transform type&lt;/a&gt; for CSS3 which can be used with Bundling and Minification till above bug got fixed in next release. So I started to search for any open source module for CSS3 minification as I was not interested in creating my own buggy module (because it may possible, I might forget to include some possible CSS3 syntax). After searching and testing a few modules I came across to JavaScript port of &lt;a href="http://developer.yahoo.com/yui/compressor/" target="_blank"&gt;YUI Compressor&lt;/a&gt; which is available at &lt;a href="http://tools.w3clubs.com/cssmin/" target="_blank"&gt;http://tools.w3clubs.com/cssmin/&lt;/a&gt; and in my test YUI Compressor pass all cases. Luckily today I found a &lt;a href="http://yuicompressor.codeplex.com" target="_blank"&gt;C# port of YUI Compressor on codeplex&lt;/a&gt;. Thanks to &lt;a href="http://www.codeplex.com/site/users/view/purekrome" target="_blank"&gt;Pure Krome&lt;/a&gt; for this work. So with the help of C# port of YUI Compressor, I have created custom transform type for CSS3 minification which can be used with ASP.NET 4.5 and MVC 4 application. &lt;a href="http://files.dotnetexpertguide.com/download.aspx?key=css3minify"&gt;CSS3Minify transform type can be downloaded from here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To use this transform type with Bundling and Minification &lt;a href="http://files.dotnetexpertguide.com/download.aspx?key=css3minify"&gt;download it from here&lt;/a&gt; and add downloaded class file into your ASP.NET 4.5 or MVC 4 application. You do not need to add reference to YUI Compressor.&lt;/p&gt;
&lt;p&gt;Open Global.asax.cs file and in Application_Start event add following two lines.&lt;/p&gt;
&lt;pre class="brush: csharp"&gt;
DynamicFolderBundle Css3Bundle = new DynamicFolderBundle("css3", typeof(CSS3Minify), "*.css", false);

BundleTable.Bundles.Add(Css3Bundle);
&lt;/pre&gt;
&lt;p&gt;That’s it now you should get your CSS3 minified. However this is temporary workaround till this bug got fixed in next version of Microsoft.Web.Optimization.&lt;/p&gt;
&lt;p&gt;Let me know if you found any problem with this.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7819331473560289523-6669586393914508412?l=www.dotnetexpertguide.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/1o7MK7oyXTyXhoG7hJC8A0yoCxs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1o7MK7oyXTyXhoG7hJC8A0yoCxs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/1o7MK7oyXTyXhoG7hJC8A0yoCxs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1o7MK7oyXTyXhoG7hJC8A0yoCxs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=r4JiVBasRlM:DcX3Wn7wyQ8:iuKBeV4sXr0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=r4JiVBasRlM:DcX3Wn7wyQ8:iuKBeV4sXr0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=r4JiVBasRlM:DcX3Wn7wyQ8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=r4JiVBasRlM:DcX3Wn7wyQ8:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=r4JiVBasRlM:DcX3Wn7wyQ8:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=r4JiVBasRlM:DcX3Wn7wyQ8:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=r4JiVBasRlM:DcX3Wn7wyQ8:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=r4JiVBasRlM:DcX3Wn7wyQ8:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=r4JiVBasRlM:DcX3Wn7wyQ8:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Dotnetexpertguide/~4/r4JiVBasRlM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.dotnetexpertguide.com/feeds/6669586393914508412/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.dotnetexpertguide.com/2011/12/aspnet45-cssminify-issue-n-workaround.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/6669586393914508412?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/6669586393914508412?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Dotnetexpertguide/~3/r4JiVBasRlM/aspnet45-cssminify-issue-n-workaround.html" title="ASP.NET 4.5 : Issue With CssMinify And Workaround For It" /><author><name>Nandip Makwana</name><uri>https://profiles.google.com/100983452498554383356</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-pDb4IK6WZRs/AAAAAAAAAAI/AAAAAAAAAf4/0K7LrsiXehI/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.dotnetexpertguide.com/2011/12/aspnet45-cssminify-issue-n-workaround.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0MDQXs9cCp7ImA9WhRXGUg.&quot;"><id>tag:blogger.com,1999:blog-7819331473560289523.post-6458607212191662174</id><published>2011-12-24T02:11:00.000+05:30</published><updated>2011-12-27T07:34:30.568+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-27T07:34:30.568+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="vNext" /><category scheme="http://www.blogger.com/atom/ns#" term="MVC" /><category scheme="http://www.blogger.com/atom/ns#" term="MVC 4" /><category scheme="http://www.blogger.com/atom/ns#" term="ASP .NET 4.5" /><title>Creating Custom Transform Type for Bundling and Minification in .NET 4.5</title><content type="html">&lt;p&gt;Yesterday, we have learnt &lt;a href="http://www.dotnetexpertguide.com/2011/12/bundling-and-minification-aspnet-mvc4.html"&gt;how to implement default Bundling and Minification with ASP.NET MVC 4&lt;/a&gt; application as well we also examined how to create custom bundle which bundle and minify only specified files. While creating custom bundle, we suppose to pass transform type to bundle. Microsoft.Web.Optimization assembly shipped with two inbuilt transform type namely JsMinify and CssMinify. In addition to built-in transform type, we can also create our own custom transform type. Today we will examine how to create custom transform type for Bundling and Minification.&lt;/p&gt;
&lt;p&gt;To create new transform type, add new class to your MVC 4 or .NET 4.5 application. For e.g. MyJsMinify. Each transform type must implement interface &lt;b&gt;IBundleTransform&lt;/b&gt; and &lt;b&gt;Process&lt;/b&gt; member function of IBundleTransform interface.&lt;/p&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-Bg7xYfith00/TvTk2Au-ofI/AAAAAAAAAg4/tFXFkt7ySwY/s1600/Transform%2Btype.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-Bg7xYfith00/TvTk2Au-ofI/AAAAAAAAAg4/tFXFkt7ySwY/s1600/Transform%2Btype.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;Process method accepts one argument of &lt;b&gt;BundleResponse&lt;/b&gt; type. This BundleResponse object is used to retrieve list of files included in bundle. Once we process retrieved files, we will assign processed response back to BundleResponse so it can send it back to browser.&lt;/p&gt;
&lt;p&gt;BundleResponse class has 4 properties. Each of them is as follow.&lt;/p&gt;
&lt;h4&gt;BundleResponse.Files&lt;/h4&gt;
&lt;p&gt;This is IEnumerable collection of files which is included in bundle.&lt;/p&gt;
&lt;h4&gt;BundleResponse.ContentType&lt;/h4&gt;
&lt;p&gt;Through this property, we can set content type for bundle so that browser can render it appropriately. Default content type "text/html".&lt;/p&gt;
&lt;h4&gt;BundleResponse.Cacheability&lt;/h4&gt;
&lt;p&gt;We can use this property to set Cache-Control HTTP header of bundled response.&lt;/p&gt;
&lt;h4&gt;BundleResponse.Content&lt;/h4&gt;
&lt;p&gt;Anything which we set as a value of this property, that content will be sent back to browser as a response of bundle.
We have examined each property of BundleResponse class. So basic steps for creating custom transform type is iterate through each file of BundleResponse.Files, process it and assign it back to BundleResponse.Content. And finally set appropriate content type and cache control if it is required.&lt;/p&gt;
&lt;p&gt;Complete code for custom transform type is given below.&lt;/p&gt;
&lt;pre class="brush: csharp"&gt;
public class MyJsMinify : IBundleTransform
{
    public void Process(BundleResponse bundle)
    {
        string strAllJS = string.Empty;
        // Collect content of each included files
        foreach (FileInfo obj in bundle.Files)
        {
            StreamReader srCSSFile = new StreamReader(obj.FullName);
            strAllJS += srCSSFile.ReadToEnd();
            srCSSFile.Close();
        }
        // Process gathered content or
        // process indivisual file in
        // loop and finally assign it back
        bundle.Content = strAllJS;
        bundle.ContentType = "text/javascript";
        bundle.Cacheability = HttpCacheability.Public;
    }
}
&lt;/pre&gt;
&lt;p&gt;Finally we can use custom transform type as we were using built-in transform type!!!&lt;/p&gt;
&lt;pre class="brush: csharp"&gt;
Bundle myJSBundle = new Bundle("~/MyJSBundle", typeof(MyJsMinify));
&lt;/pre&gt;
&lt;p&gt;Hope this would be helpful.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7819331473560289523-6458607212191662174?l=www.dotnetexpertguide.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/4-S2zA4IfNUs2asNVv_2RHHGmqw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/4-S2zA4IfNUs2asNVv_2RHHGmqw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/4-S2zA4IfNUs2asNVv_2RHHGmqw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/4-S2zA4IfNUs2asNVv_2RHHGmqw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=du8dIZdn9OE:VYFu3n5Oa8M:iuKBeV4sXr0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=du8dIZdn9OE:VYFu3n5Oa8M:iuKBeV4sXr0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=du8dIZdn9OE:VYFu3n5Oa8M:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=du8dIZdn9OE:VYFu3n5Oa8M:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=du8dIZdn9OE:VYFu3n5Oa8M:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=du8dIZdn9OE:VYFu3n5Oa8M:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=du8dIZdn9OE:VYFu3n5Oa8M:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=du8dIZdn9OE:VYFu3n5Oa8M:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=du8dIZdn9OE:VYFu3n5Oa8M:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Dotnetexpertguide/~4/du8dIZdn9OE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.dotnetexpertguide.com/feeds/6458607212191662174/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.dotnetexpertguide.com/2011/12/custom-transformtype-bundling.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/6458607212191662174?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/6458607212191662174?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Dotnetexpertguide/~3/du8dIZdn9OE/custom-transformtype-bundling.html" title="Creating Custom Transform Type for Bundling and Minification in .NET 4.5" /><author><name>Nandip Makwana</name><uri>https://profiles.google.com/100983452498554383356</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-pDb4IK6WZRs/AAAAAAAAAAI/AAAAAAAAAf4/0K7LrsiXehI/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-Bg7xYfith00/TvTk2Au-ofI/AAAAAAAAAg4/tFXFkt7ySwY/s72-c/Transform%2Btype.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.dotnetexpertguide.com/2011/12/custom-transformtype-bundling.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU8DQH89eip7ImA9WhRWEUg.&quot;"><id>tag:blogger.com,1999:blog-7819331473560289523.post-1938477508812986720</id><published>2011-12-23T09:08:00.000+05:30</published><updated>2011-12-29T15:47:51.162+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-29T15:47:51.162+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="vNext" /><category scheme="http://www.blogger.com/atom/ns#" term="MVC" /><category scheme="http://www.blogger.com/atom/ns#" term="MVC 4" /><title>Bundling and Minification in ASP.NET MVC 4</title><content type="html">&lt;p&gt;This post is part of &lt;a target="_blank" href="http://www.dotnetexpertguide.com/2011/09/aspnet-mvc-4-article-series.html"&gt;ASP .NET MVC 4 Article Series&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In &lt;a href="http://www.dotnetexpertguide.com/2011/12/efficient-use-of-jquery-object.html"&gt;yesterday’s post&lt;/a&gt;, we have discussed that in today’s web application, client side operation is also important as much as server operation. And hence client side operation increase, JavaScript code is also increased and for maintainability of code we generally separate it by functionality in different files. Hence separated code is JavaScript so web page needs to reference many JavaScript files. Now the trouble may starts, as all browsers limits the parallel request and request beyond that limits goes in queue. More information on each browser can be found &lt;a href="http://www.browserscope.org/" target="_blank"&gt;here on Browserscope&lt;/a&gt;. To overcome this we can combine all JavaScript files in one. But as far as code maintainability is concern this is not the right solutions. Another way is to combine and minify all files on the fly. This is also sound to be right solution than combining all JavaScript files into one. Here we will see how we can leverage the Microsoft.Web.Optimization assembly to achieve this.&lt;/p&gt;
&lt;p&gt;With .NET 4.5, Microsoft introduced a new featured called Bundling and Minification which bundle multiple JavaScript and CSS files in one requests and minify it by removing white spaces and characters which is not required. Microsoft introduced a new class called BundleTable which take care of Bundling and Minification. BundleTable class is shipped with two inbuilt Bundle for JavaScript and CSS respectively. However one can easily create their own custom Bundle as per requirements. Here we will see how we implement Bundling and Minification in MVC 4 application.&lt;/p&gt;
&lt;p&gt;To get started, create new MVC 4 application, build it and open it in Firefox or any other browser. And inspect the loaded JavaScript information with the help of developer tools of browser you are using.&lt;/p&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-CLwqquW8Lr8/TvPuI6CElHI/AAAAAAAAAgg/qPFtl4V7ack/s1600/MVC4%2B1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="120" src="http://1.bp.blogspot.com/-CLwqquW8Lr8/TvPuI6CElHI/AAAAAAAAAgg/qPFtl4V7ack/s640/MVC4%2B1.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;We can see in above image that before implementing Bundling and Minification, browser requests &lt;b&gt;four JavaScript files&lt;/b&gt; and total size of JavaScript files are &lt;b&gt;503.8KB&lt;/b&gt;. Now let enable Bundling with MVC 4 application and again inspect the loaded JavaScript to check how it benefit. We discuses earlier that BundleTable shipped with two inbuilt Bundle one for JavaScript and one for CSS. So first of all let enable this default Bundle. Later we will also see how we can create our own custom Bundle also. To enable default bundling, open global.asax.cs and in Application_Start events write following lines.&lt;/p&gt;
&lt;pre class="brush: csharp"&gt;
BundleTable.Bundles.EnableDefaultBundles();
&lt;/pre&gt;
&lt;p&gt;We have enabled default bundles, but still we have not referenced it in view. Open _Layout.cshtml and looks for following lines in Head tag.&lt;/p&gt;
&lt;script type="syntaxhighlighter" class="brush: html"&gt;&lt;![CDATA[
&lt;script src="@Url.Content("~/Scripts/jquery-1.6.2.min.js")" type="text/javascript"&gt;&amp;lt;/script&gt;
&lt;script src="@Url.Content("~/Scripts/jquery-ui-1.8.11.js")" type="text/javascript"&gt;&amp;lt;/script&gt;
&lt;script src="@Url.Content("~/Scripts/modernizr-2.0.6-development-only.js")" type="text/javascript"&gt;&amp;lt;/script&gt;
&lt;script src="@Url.Content("~/Scripts/AjaxLogin.js")" type="text/javascript"&gt;&amp;lt;/script&gt;
]]&gt;&lt;/script&gt;
&lt;p&gt;Replace above lines with following line to reference default JavaScript Bundle and press Ctrl + F5 to see Bundling and Minification in action.&lt;/p&gt;
&lt;script type="syntaxhighlighter" class="brush: html"&gt;&lt;![CDATA[
&lt;script src="@Url.Content("~/Scripts/js")" type="text/javascript"&gt;&amp;lt;/script&gt;
]]&gt;&lt;/script&gt;
&lt;p&gt;Again inspect JavaScript information, after enabling default bundle. We can see in below image that browser request only &lt;b&gt;one JavaScript file&lt;/b&gt; which is combination of previously loaded four files. Moreover if you will look at size of loaded JavaScript then you will find that it is also reduced by almost 25% previously it was total 503.8KB and after Minification it is just 359.8KB!!!&lt;/p&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-3m5ZJgfXrA0/TvPuIzGq4wI/AAAAAAAAAgw/tsgSaZKHsuk/s1600/MVC4%2B2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="100" src="http://3.bp.blogspot.com/-3m5ZJgfXrA0/TvPuIzGq4wI/AAAAAAAAAgw/tsgSaZKHsuk/s640/MVC4%2B2.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h4&gt;Bundling and Minification with CSS&lt;/h4&gt;
&lt;p&gt;Same way we can also reference bundled and minified CSS by replacing default CSS reference with following one in _Layout.cshtml. However Bundling and Minification does not works with CSS3 rules. It is also logged &lt;a href="http://connect.microsoft.com/VisualStudio/feedback/details/696436/microsoft-web-optimization-cannot-compress-css3-animations" target="_blank"&gt;here on connect.microsoft.com&lt;/a&gt;. I have posted temporary workaround for it here in my post: &lt;b&gt;&lt;a href="http://www.dotnetexpertguide.com/2011/12/aspnet45-cssminify-issue-n-workaround.html"&gt;ASP.NET 4.5 : Issue With CssMinify And Workaround For It&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;
&lt;script type="syntaxhighlighter" class="brush: html"&gt;&lt;![CDATA[
&lt;script src="@Url.Content("~/Content/CSS")" type="text/javascript"&gt;&amp;lt;/script&gt;
]]&gt;&lt;/script&gt;
&lt;h4&gt;Creating custom Bundle with .NET 4.5 and MVC 4&lt;/h4&gt;
&lt;p&gt;So far we have used default bundle. Now we will create one custom bundle which will bundle and minify only required files. To create custom bundle we need to create object of Bundle class by specifying virtual path through which we can reference custom bundle and transform type whether it is JavaScript or CSS. Complete code for creating custom bundle is as follow. Write following code snippet in Application_Start event.&lt;/p&gt;
&lt;pre class="brush: csharp"&gt;
Bundle myJSBundle = new Bundle("~/MyJSBundle", typeof(JsMinify));

myJSBundle.AddDirectory("~/Scripts", "*.js", false);
myJSBundle.AddFile("~/Scripts/jquery.validate.min.js");
myJSBundle.AddFile("~/Scripts/common.js");

BundleTable.Bundles.Add(myJSBundle);
&lt;/pre&gt;
&lt;p&gt;To reference created custom bundle, write following lines in respective view.&lt;/p&gt;
&lt;script type="syntaxhighlighter" class="brush: html"&gt;&lt;![CDATA[
&lt;script src="@Url.Content("~/MyJSBundle")" type="text/javascript"&gt;&amp;lt;/script&gt;
]]&gt;&lt;/script&gt;
&lt;h4&gt;Conclusion&lt;/h4&gt;
&lt;p&gt;With vNext or .NET 4.5, it is easier to implement Bundling and Minification with very less effort and without major changes. &lt;/p&gt;
&lt;p&gt;Hope this would be helpful.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7819331473560289523-1938477508812986720?l=www.dotnetexpertguide.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/zjM3FqIwZlko6gMMDcGTPjqkX0A/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/zjM3FqIwZlko6gMMDcGTPjqkX0A/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/zjM3FqIwZlko6gMMDcGTPjqkX0A/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/zjM3FqIwZlko6gMMDcGTPjqkX0A/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=b0JeM3OXw_M:0eG5No29irk:iuKBeV4sXr0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=b0JeM3OXw_M:0eG5No29irk:iuKBeV4sXr0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=b0JeM3OXw_M:0eG5No29irk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=b0JeM3OXw_M:0eG5No29irk:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=b0JeM3OXw_M:0eG5No29irk:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=b0JeM3OXw_M:0eG5No29irk:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=b0JeM3OXw_M:0eG5No29irk:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=b0JeM3OXw_M:0eG5No29irk:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=b0JeM3OXw_M:0eG5No29irk:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Dotnetexpertguide/~4/b0JeM3OXw_M" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.dotnetexpertguide.com/feeds/1938477508812986720/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.dotnetexpertguide.com/2011/12/bundling-and-minification-aspnet-mvc4.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/1938477508812986720?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/1938477508812986720?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Dotnetexpertguide/~3/b0JeM3OXw_M/bundling-and-minification-aspnet-mvc4.html" title="Bundling and Minification in ASP.NET MVC 4" /><author><name>Nandip Makwana</name><uri>https://profiles.google.com/100983452498554383356</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-pDb4IK6WZRs/AAAAAAAAAAI/AAAAAAAAAf4/0K7LrsiXehI/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-CLwqquW8Lr8/TvPuI6CElHI/AAAAAAAAAgg/qPFtl4V7ack/s72-c/MVC4%2B1.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.dotnetexpertguide.com/2011/12/bundling-and-minification-aspnet-mvc4.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkEAQHo6eSp7ImA9WhRXFU8.&quot;"><id>tag:blogger.com,1999:blog-7819331473560289523.post-6534207911380802846</id><published>2011-12-22T08:58:00.001+05:30</published><updated>2011-12-22T09:00:41.411+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-22T09:00:41.411+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="jQuery" /><title>Efficient Use Of jQuery Object</title><content type="html">&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-Dijm9Fqhr68/TvKheDyOllI/AAAAAAAAAgU/Tlj7hXS_vtU/s1600/jQuery.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="81" src="http://3.bp.blogspot.com/-Dijm9Fqhr68/TvKheDyOllI/AAAAAAAAAgU/Tlj7hXS_vtU/s200/jQuery.png" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;Day by day, &lt;a href="http://jquery.com/" target="_blank"&gt;jQuery&lt;/a&gt; is becoming a more popular and it is widely used instead core JavaScript. With ASP.NET &amp; ASP.NET MVC also there are so many good examples available on net to get best of both. Moreover default project template of ASP.NET MVC is also including latest jQuery file for easiness of client operation.&lt;/p&gt;
&lt;p&gt;To perform any jQuery operation, first we need to select target DOM element or set of DOM elements. And we are living (rather programming) in the era of web 2.0 and Mashup where web documents are suppose to be large with few hundred elements and lots of client side operation as well. So here we will see how one small tip can be helpful to improve jQuery performance.&lt;/p&gt;
&lt;p&gt;Many a time we have seen developer to perform a various operation on a specific DOM element or specific set of DOM element as described below.&lt;/p&gt;
&lt;pre class="brush: js"&gt;
$("#MyDiv").show();
$("#MyDiv").addClass("header");
$("#MyDiv").css("height","100");
&lt;/pre&gt;
&lt;p&gt;However nothing is wrong in above code and it will works fine without any error. But there is a lot to improvements in above code. In above example we are selecting "MyDiv" elements three times; means for each of three operations, jQuery will search for "MyDiv" in whole document and then after it will perform specific operation on it. There are two different ways to overcome this overhead. Both are explained below.&lt;/p&gt;
&lt;h4&gt;jQuery Chaining 'em up&lt;/h4&gt;
&lt;pre class="brush: js"&gt;
$("#MyDiv").show().addClass("header").css("height","100");
&lt;/pre&gt;
&lt;p&gt;As displayed in above example, if we are supposed to use specific DOM elements or set of DOM elements in one code block only, Then we should use jQuery Chaining pattern as displayed above. In this it will select "MyDiv" only once. As we know that after performing any jQuery operation, it will return jQuery object so we can directly use that returned jQuery object to perform next operation and can form chaining pattern.&lt;/p&gt;
&lt;h4&gt;Cache jQuery Object&lt;/h4&gt;
&lt;pre class="brush: js"&gt;
var myDivElement = $("#MyDiv");
myDivElement.show();
myDivElement.addClass("header");
myDivElement.css("height","100");
&lt;/pre&gt;
&lt;p&gt;jQuery chaining pattern is suitable when we are suppose to perform multiple operation in one code block only, but it will not helpful when we have to perform multiple operation from different-different code block. In such situation we should cache jQuery object as displayed in above example and then after use cached object instead selecting it each and every times.&lt;/p&gt;
&lt;p&gt;Hope this would be helpful.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7819331473560289523-6534207911380802846?l=www.dotnetexpertguide.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/FFVYLWFUx5Pa_2zKHsFEqZkfrMM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/FFVYLWFUx5Pa_2zKHsFEqZkfrMM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/FFVYLWFUx5Pa_2zKHsFEqZkfrMM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/FFVYLWFUx5Pa_2zKHsFEqZkfrMM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=Jnco2hsX5KQ:2smlzgcCHjc:iuKBeV4sXr0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=Jnco2hsX5KQ:2smlzgcCHjc:iuKBeV4sXr0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=Jnco2hsX5KQ:2smlzgcCHjc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=Jnco2hsX5KQ:2smlzgcCHjc:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=Jnco2hsX5KQ:2smlzgcCHjc:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=Jnco2hsX5KQ:2smlzgcCHjc:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=Jnco2hsX5KQ:2smlzgcCHjc:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=Jnco2hsX5KQ:2smlzgcCHjc:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=Jnco2hsX5KQ:2smlzgcCHjc:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Dotnetexpertguide/~4/Jnco2hsX5KQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.dotnetexpertguide.com/feeds/6534207911380802846/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.dotnetexpertguide.com/2011/12/efficient-use-of-jquery-object.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/6534207911380802846?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/6534207911380802846?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Dotnetexpertguide/~3/Jnco2hsX5KQ/efficient-use-of-jquery-object.html" title="Efficient Use Of jQuery Object" /><author><name>Nandip Makwana</name><uri>https://profiles.google.com/100983452498554383356</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-pDb4IK6WZRs/AAAAAAAAAAI/AAAAAAAAAf4/0K7LrsiXehI/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-Dijm9Fqhr68/TvKheDyOllI/AAAAAAAAAgU/Tlj7hXS_vtU/s72-c/jQuery.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.dotnetexpertguide.com/2011/12/efficient-use-of-jquery-object.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkQHSHc5fyp7ImA9WhRXEkU.&quot;"><id>tag:blogger.com,1999:blog-7819331473560289523.post-5634490661984577869</id><published>2011-12-19T14:15:00.001+05:30</published><updated>2011-12-19T14:15:39.927+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-19T14:15:39.927+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Review" /><category scheme="http://www.blogger.com/atom/ns#" term="Wait Stats" /><category scheme="http://www.blogger.com/atom/ns#" term="Book Review" /><category scheme="http://www.blogger.com/atom/ns#" term="SQL" /><title>SQL Wait Stats Joes 2 Pros Review</title><content type="html">&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-uHuNnIBYYdk/Tu71e8akilI/AAAAAAAAAgI/p7XnyttiMeI/s1600/sql%2Bwait%2Bstat%2Bjoes%2B2%2Bpros.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://4.bp.blogspot.com/-uHuNnIBYYdk/Tu71e8akilI/AAAAAAAAAgI/p7XnyttiMeI/s320/sql%2Bwait%2Bstat%2Bjoes%2B2%2Bpros.jpg" width="213" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;Last month on 5th Anniversary give away of &lt;a href="http://blog.sqlauthority.com/" target="_blank"&gt;http://blog.sqlauthority.com/&lt;/a&gt; , I received, &lt;b&gt;SQL Wait Stats Joes 2 Pros&lt;/b&gt; book from &lt;a href="http://www.facebook.com/SQLAuth" target="_blank"&gt;Pinal Dave&lt;/a&gt;. Although I am not a SQL developer but I was very curious to know more about SQL Wait Stats since the June 11, 2011 (day, I attended Pinal Dave’s session on Wait Stats at Community Tech Day, Ahmadabad) as it affect the &lt;a target="_blank" href="http://www.dotnetexpertguide.com/2011/12/efficiencies-use-of-try-catch-block.html"&gt;overall performance of system&lt;/a&gt;. As I told I am not SQL developer, so after that day, I could not bother (frankly telling) to look into book when it is published. Luckily, Last month &lt;a href="http://twitter.com/#!/NandipMakwana/status/138994677633396737" target="_blank"&gt;I received book from Pinal Dave&lt;/a&gt; on 5th anniversary of his blog. And surprisingly after starting to read it I could not stop it and completed whole book in one seating! And I realized that I could have missed many things if I have not received the book. I would highly recommend all reader of this blog to read this book once. So I thought to write on why this book is special for person who has to deals with SQL server (and of course to convey my gratitude towards Pinal Dave also).&lt;/p&gt;
&lt;h4&gt;Real world example&lt;/h4&gt;
&lt;p&gt;One of the best parts of this book is that each and every topic in this book is explained with real life example just like &lt;a href="http://headfirstlabs.com/" target="_blank"&gt;Head First Series&lt;/a&gt; except graphical representation. But I am sure examples used in this book are very much easy to understand and uses day to day life example.&lt;/p&gt;
&lt;h4&gt;Covered Beginner to Advance Level Topic&lt;/h4&gt;
&lt;p&gt;Another great feature about this small book (110 pages only) is that it starts with beginner level introduction and end with justifying advance level topics. For e.g. Wait Stats on Multi-tasking, external resources, etc.&lt;/p&gt;
&lt;h4&gt;System Architecture&lt;/h4&gt;
&lt;p&gt;Apart from exploration of SQL Wait Stats, if you are little interested in knowing &lt;a href="http://www.dotnetexpertguide.com/2011/09/under-hood-of-display-mode-mvc-4.html" target="_blank"&gt;Under the hood&lt;/a&gt; of system then also this book is useful for you to get started thinking on how actual systems work.&lt;/p&gt;
&lt;h4&gt;Practical hands-on example&lt;/h4&gt;
&lt;p&gt;Each chapter of this book is wrapped with ready to use hands on example and exercise so reader can directly use that example on their machine and can get started to explore around it.&lt;/p&gt;
&lt;h4&gt;Points to Ponder Section&lt;/h4&gt;
&lt;p&gt;Each chapter of this book is committed (so there is no need of rollback) with "Points to Ponder Section" which include quick review of the points covered in respective chapter and review quiz for a quick refresh.&lt;/p&gt;
&lt;p&gt;SQL Wait Stats Joes 2 Pros on &lt;a href="http://www.flipkart.com/books/1466234776" target="_blank"&gt;Flipkart&lt;/a&gt; | &lt;a target="_blank" href="http://www.amazon.com/SQL-Wait-Stats-Joes-Pros/dp/1466234776"&gt;Amazon&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7819331473560289523-5634490661984577869?l=www.dotnetexpertguide.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/IYIoNOSlClwj9vaBg19Av-vkW-A/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/IYIoNOSlClwj9vaBg19Av-vkW-A/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/IYIoNOSlClwj9vaBg19Av-vkW-A/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/IYIoNOSlClwj9vaBg19Av-vkW-A/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=ZNfFt6XTquA:3N4RlMqaHBs:iuKBeV4sXr0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=ZNfFt6XTquA:3N4RlMqaHBs:iuKBeV4sXr0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=ZNfFt6XTquA:3N4RlMqaHBs:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=ZNfFt6XTquA:3N4RlMqaHBs:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=ZNfFt6XTquA:3N4RlMqaHBs:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=ZNfFt6XTquA:3N4RlMqaHBs:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=ZNfFt6XTquA:3N4RlMqaHBs:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=ZNfFt6XTquA:3N4RlMqaHBs:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=ZNfFt6XTquA:3N4RlMqaHBs:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Dotnetexpertguide/~4/ZNfFt6XTquA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.dotnetexpertguide.com/feeds/5634490661984577869/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.dotnetexpertguide.com/2011/12/sql-wait-stats-joes-2-pros-review.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/5634490661984577869?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/5634490661984577869?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Dotnetexpertguide/~3/ZNfFt6XTquA/sql-wait-stats-joes-2-pros-review.html" title="SQL Wait Stats Joes 2 Pros Review" /><author><name>Nandip Makwana</name><uri>https://profiles.google.com/100983452498554383356</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-pDb4IK6WZRs/AAAAAAAAAAI/AAAAAAAAAf4/0K7LrsiXehI/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-uHuNnIBYYdk/Tu71e8akilI/AAAAAAAAAgI/p7XnyttiMeI/s72-c/sql%2Bwait%2Bstat%2Bjoes%2B2%2Bpros.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.dotnetexpertguide.com/2011/12/sql-wait-stats-joes-2-pros-review.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEcGSXczfSp7ImA9WhRQF0Q.&quot;"><id>tag:blogger.com,1999:blog-7819331473560289523.post-5802253256075604352</id><published>2011-12-13T22:15:00.000+05:30</published><updated>2011-12-13T22:37:08.985+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-13T22:37:08.985+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MVC" /><category scheme="http://www.blogger.com/atom/ns#" term="MVC 4" /><title>Upgrading an ASP.NET MVC 3 Project to ASP.NET MVC 4</title><content type="html">&lt;p&gt;This post is part of &lt;a href="http://www.dotnetexpertguide.com/2011/09/aspnet-mvc-4-article-series.html" target="_blank"&gt;ASP .NET MVC 4 Article Series&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To upgrade and existing ASP.NET MVC 3 Project to ASP.NET MVC 4, one need to take care of following points. Complete guideline on upgrading from MVC 3 to MVC 4 is available in &lt;a target="_blank" href="http://www.asp.net/whitepapers/mvc4-release-notes#_Toc303253806"&gt;MVC 4 Release Notes&lt;/a&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;In all web.config, including one in root folder and Views folder, change assembly version 3.0.0.0 to 4.0.0.0 for System.Web.Mvc and 1.0.0.0 to 2.0.0.0 for System.Web.WebPages, System.Web.Helpers, System.Web.WebPages.Razor.&lt;/li&gt;
&lt;li&gt;Change appSettings value for key "webPages:Version" to "2.0.0.0". Apart from that also add new appSettings key named "PreserveLoginUrl" with "true" as a value. More information on PreserveLoginUrl key &lt;a href="http://connect.microsoft.com/webmatrix/feedback/details/665150/including-webmatrix-data-dll-webmatrix-webdata-dll-overrides-forms-loginurl" target="_blank"&gt;can be found here&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Now remove all reference to MVC 3.0 assembly and Webpages 1.0 assembly. And add a reference to MVC 4.0 assembly and Webpages 2.0 assembly.&lt;/li&gt;
&lt;li&gt;If you are using any third party assembly built with previous versions of MVC then do not forget to configure bindingredirect in root web.config as &lt;a href="http://www.asp.net/whitepapers/mvc4-release-notes#_Toc303253806" target="_blank"&gt;mentioned here&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Finally one more step is to change project type to MVC 4 from MVC 3. For that unload project by right clicking in solution explorer and select edit ProjectName.csproj file. Now Locate the ProjectTypeGuids element and replace {E53F8FEA-EAE0-44A6-8774-FFD645390401} with {E3E379DF-F4C6-4180-9B81-6769533ABE47}. Now save changes and re load the project.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Complete step by step information is given here in &lt;a href="http://www.asp.net/whitepapers/mvc4-release-notes#_Toc303253806" target="_blank"&gt;MVC 4 Release Notes&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7819331473560289523-5802253256075604352?l=www.dotnetexpertguide.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/FH7IcXgt2BMJB7iPrLQaDAKm9jE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/FH7IcXgt2BMJB7iPrLQaDAKm9jE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/FH7IcXgt2BMJB7iPrLQaDAKm9jE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/FH7IcXgt2BMJB7iPrLQaDAKm9jE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=h-b_nnYm4E0:lZHvb0OaXcA:iuKBeV4sXr0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=h-b_nnYm4E0:lZHvb0OaXcA:iuKBeV4sXr0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=h-b_nnYm4E0:lZHvb0OaXcA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=h-b_nnYm4E0:lZHvb0OaXcA:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=h-b_nnYm4E0:lZHvb0OaXcA:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=h-b_nnYm4E0:lZHvb0OaXcA:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=h-b_nnYm4E0:lZHvb0OaXcA:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=h-b_nnYm4E0:lZHvb0OaXcA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=h-b_nnYm4E0:lZHvb0OaXcA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Dotnetexpertguide/~4/h-b_nnYm4E0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.dotnetexpertguide.com/feeds/5802253256075604352/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.dotnetexpertguide.com/2011/12/upgrade-aspnet-mvc-3-project-to-mvc-4.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/5802253256075604352?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/5802253256075604352?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Dotnetexpertguide/~3/h-b_nnYm4E0/upgrade-aspnet-mvc-3-project-to-mvc-4.html" title="Upgrading an ASP.NET MVC 3 Project to ASP.NET MVC 4" /><author><name>Nandip Makwana</name><uri>https://profiles.google.com/100983452498554383356</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-pDb4IK6WZRs/AAAAAAAAAAI/AAAAAAAAAf4/0K7LrsiXehI/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.dotnetexpertguide.com/2011/12/upgrade-aspnet-mvc-3-project-to-mvc-4.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0cFRnwzcSp7ImA9WhRQFEk.&quot;"><id>tag:blogger.com,1999:blog-7819331473560289523.post-4739046287020401278</id><published>2011-12-09T07:29:00.001+05:30</published><updated>2011-12-09T22:13:37.289+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-09T22:13:37.289+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="C-Sharp" /><category scheme="http://www.blogger.com/atom/ns#" term="ASP .NET" /><category scheme="http://www.blogger.com/atom/ns#" term="C#" /><category scheme="http://www.blogger.com/atom/ns#" term="Visual Studio" /><title>Summarizing DateTime.Now &amp; StopWatch In C#</title><content type="html">&lt;p&gt;In last post, &lt;a href="http://www.dotnetexpertguide.com/2011/12/efficiencies-use-of-try-catch-block.html"&gt;Efficient Use of Try Catch Block&lt;/a&gt;, we have used &lt;a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.stopwatch.aspx" target="_blank"&gt;StopWatch&lt;/a&gt; class to measure CPU ticks consumed by particular code execution. After reading that one of the reader asked cant we use &lt;a href="http://msdn.microsoft.com/en-us/library/system.datetime.now.aspx" target="_blank"&gt;DateTime.Now&lt;/a&gt; instead. So here I have tried to explain the same.&lt;/p&gt;
&lt;p&gt;Many times we have found developer to use DateTime.Now to measure the performance of code execution. But if you google it out, you will find plenty of source which recommend using StopWatch class instead DateTime.Now. Here I am summarizing few of them.&lt;/p&gt;
&lt;h4&gt;As per the &lt;a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.stopwatch.aspx" target="_blank"&gt;MSDN&lt;/a&gt;&lt;/h4&gt;
&lt;p style="background-color:#EEEEEE;margin-bottom:10px;padding:10px 10px 1px;"&gt;The Stopwatch measures elapsed time by counting timer ticks in the underlying timer mechanism. If the installed hardware and operating system support a high-resolution performance counter, then the Stopwatch class uses that counter to measure elapsed time. Otherwise, the Stopwatch class uses the system timer to measure elapsed time. Use the Frequency and IsHighResolution fields to determine the precision and resolution of the Stopwatch timing implementation.&lt;/p&gt;
&lt;p&gt;It means StopWatch class uses higher resolution / precision than DateTime.Now. So it is worth to use StopWatch class for more accurate result.&lt;/p&gt;
&lt;p&gt;One more thing we need to consider while using DateTime.Now function is that DateTime.Now return Date and Time after applying system time zone and daylight saving time settings. So it also adds overhead to the DateTime.Now function.&lt;/p&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-McWwaP5nwZc/TuFrSmhKceI/AAAAAAAAAec/1Vw59s_6_OI/s1600/stopwatch1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-McWwaP5nwZc/TuFrSmhKceI/AAAAAAAAAec/1Vw59s_6_OI/s1600/stopwatch1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;In above output, we can see that DateTime.Now return time zone applied value (UTC +05:30 in my case). So one may recommend using &lt;a href="http://msdn.microsoft.com/en-us/library/system.datetime.utcnow.aspx" target="_blank"&gt;DateTime.UtcNow&lt;/a&gt; to overcome time zone calculation overhead. But it will not also helpful. Continue reading what is difference between DateTime.Now and DateTime.UtcNow :)&lt;/p&gt;
&lt;p&gt;Moreover StopWatch class is shipped under &lt;a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.aspx" target="_blank"&gt;System.Diagnostics&lt;/a&gt; namespaces hence Microsoft designed StopWatch class keeping in mind that it would more useful for diagnosis purpose and provide utmost accurate result.&lt;/p&gt;
&lt;p&gt;However as per &lt;a href="http://www.blogger.com/profile/10166875045633291938" target="_blank"&gt;Barfield&lt;/a&gt;’s comment on &lt;a href="http://jaychapman.blogspot.com/2007/12/datetimenow-precision-issues-enter.html" target="_blank"&gt;John Chapman&lt;/a&gt;’s blog that StopWatch uses more system resources. But I don’t think that you will consider it while you are benchmarking your system.&lt;/p&gt;
&lt;p&gt;We have enough discussion. Now let see one small example which shows clear measurement difference discussed here.&lt;/p&gt;
&lt;h4&gt;Use of DateTime.Now&lt;/h4&gt;
&lt;pre class="brush: csharp"&gt;DateTime dtStart;
DateTime dtEnd;
TimeSpan tsDifference;

dtStart = DateTime.Now;
System.Threading.Thread.Sleep(500);
dtEnd = DateTime.Now;

tsDifference = dtEnd - dtStart;

Console.WriteLine("CPU Ticks Count With Now : " + tsDifference.Ticks);&lt;/pre&gt;
&lt;h4&gt;Output:&lt;/h4&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-Ip1QJC9KKUg/TuFrSyblYiI/AAAAAAAAAek/j5LLo29WHk4/s1600/stopwatch2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-Ip1QJC9KKUg/TuFrSyblYiI/AAAAAAAAAek/j5LLo29WHk4/s1600/stopwatch2.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h4&gt;Use of DateTime.UtcNow&lt;/h4&gt;
&lt;pre class="brush: csharp"&gt;DateTime dtStart;
DateTime dtEnd;
TimeSpan tsDifference;

dtStart = DateTime.UtcNow;
System.Threading.Thread.Sleep(500);
dtEnd = DateTime.UtcNow;

tsDifference = dtEnd - dtStart;

Console.WriteLine("CPU Ticks Count With UtcNow : " + tsDifference.Ticks);&lt;/pre&gt;
&lt;h4&gt;Output:&lt;/h4&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-L5kCD0Ff8xM/TuFrTCefB3I/AAAAAAAAAew/sHle5Iz3bFY/s1600/stopwatch3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-L5kCD0Ff8xM/TuFrTCefB3I/AAAAAAAAAew/sHle5Iz3bFY/s1600/stopwatch3.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h4&gt;Use of StopWatch&lt;/h4&gt;
&lt;pre class="brush: csharp"&gt;Stopwatch sw = new Stopwatch();

sw.Start();
System.Threading.Thread.Sleep(500);
sw.Stop();

Console.WriteLine("CPU Ticks Count With StopWatch : " + sw.ElapsedTicks);&lt;/pre&gt;
&lt;h4&gt;Output:&lt;/h4&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-1osqqgbpmCQ/TuFrTXDs4cI/AAAAAAAAAe8/LgHVDpzcNs8/s1600/stopwatch4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-1osqqgbpmCQ/TuFrTXDs4cI/AAAAAAAAAe8/LgHVDpzcNs8/s1600/stopwatch4.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h4&gt;Conclusion&lt;/h4&gt;
&lt;p&gt;Based on above discussion and example, we can clearly see that use of StopWatch is preferable over DateTime.Now and DateTime.UtcNow as Stopwatch provide more accurate result.&lt;/p&gt;
&lt;p&gt;What do you say reader???&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7819331473560289523-4739046287020401278?l=www.dotnetexpertguide.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/RHA3MuztcWG9ISkiVE-Gu8zhBG4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RHA3MuztcWG9ISkiVE-Gu8zhBG4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/RHA3MuztcWG9ISkiVE-Gu8zhBG4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RHA3MuztcWG9ISkiVE-Gu8zhBG4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=fj-XnoiOlX4:Wten-j5kelE:iuKBeV4sXr0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=fj-XnoiOlX4:Wten-j5kelE:iuKBeV4sXr0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=fj-XnoiOlX4:Wten-j5kelE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=fj-XnoiOlX4:Wten-j5kelE:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=fj-XnoiOlX4:Wten-j5kelE:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=fj-XnoiOlX4:Wten-j5kelE:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=fj-XnoiOlX4:Wten-j5kelE:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=fj-XnoiOlX4:Wten-j5kelE:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=fj-XnoiOlX4:Wten-j5kelE:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Dotnetexpertguide/~4/fj-XnoiOlX4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.dotnetexpertguide.com/feeds/4739046287020401278/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.dotnetexpertguide.com/2011/12/summarizing-datetimenow-stopwatch-in-c.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/4739046287020401278?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/4739046287020401278?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Dotnetexpertguide/~3/fj-XnoiOlX4/summarizing-datetimenow-stopwatch-in-c.html" title="Summarizing DateTime.Now &amp; StopWatch In C#" /><author><name>Nandip Makwana</name><uri>https://profiles.google.com/100983452498554383356</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-pDb4IK6WZRs/AAAAAAAAAAI/AAAAAAAAAf4/0K7LrsiXehI/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-McWwaP5nwZc/TuFrSmhKceI/AAAAAAAAAec/1Vw59s_6_OI/s72-c/stopwatch1.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.dotnetexpertguide.com/2011/12/summarizing-datetimenow-stopwatch-in-c.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUUMQXo7eip7ImA9WhRQE0Q.&quot;"><id>tag:blogger.com,1999:blog-7819331473560289523.post-5837964201714754092</id><published>2011-12-06T07:51:00.001+05:30</published><updated>2011-12-09T07:51:20.402+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-09T07:51:20.402+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="C-Sharp" /><category scheme="http://www.blogger.com/atom/ns#" term="ASP .NET" /><category scheme="http://www.blogger.com/atom/ns#" term="C#" /><category scheme="http://www.blogger.com/atom/ns#" term="Visual Studio" /><title>Efficient Use of Try Catch Block</title><content type="html">&lt;p&gt;In all application, whether it is web or desktop, whether it is built in .NET or JAVA or any other language, we all are using (and we should use if we are not!) &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/0yd65esw.aspx"&gt;Try Catch Block&lt;/a&gt; or similar available mechanism to handle the exception.&lt;/p&gt;
&lt;p&gt;But recently while I was working on one application, I observed that Try Catch Block was also used to make decision!!! As Try Catch mechanism is provided to handle exception and hence it is heavy operation and utilizes more CPU, we should not use Try Catch for such decision making scenario. Instead we should look for any alternate solution. Let try to understand whole scenario by formulating one small example.&lt;/p&gt;
&lt;p&gt;In all below example, I am using &lt;a href="http://www.dotnetexpertguide.com/2011/12/summarizing-datetimenow-stopwatch-in-c.html"&gt;System.Diagnostics.Stopwatch&lt;/a&gt; class to count CPU ticks consumed by particular task.&lt;/p&gt;
&lt;h4&gt;Example 1 Scenario 1 : With Try Catch&lt;/h4&gt;
&lt;pre class="brush: csharp"&gt;string strPrice = "abc";
int Price;           
Stopwatch sw = new Stopwatch();
sw.Start();

try
{
    Price = Int32.Parse(strPrice);
    // DO SOMETHING
}
catch (Exception ex)
{
    Price = 0;
    // DO SOMETHING
}

sw.Stop();
Console.WriteLine("CPU Ticks Used For Parsing : " + sw.ElapsedTicks.ToString());&lt;/pre&gt;
&lt;h4&gt;Output:&lt;/h4&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-PEEgU-UD-gQ/Tt18omIl_CI/AAAAAAAAAds/kLQJWns0jJc/s1600/TryCatch1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-PEEgU-UD-gQ/Tt18omIl_CI/AAAAAAAAAds/kLQJWns0jJc/s1600/TryCatch1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;In above example, we are parsing string into integer within Try block and performing some operation (If part of if else condition). And if we are unable to parse string (as displayed in above case), it throws an exception and goes in Catch block and there we perform some other operation (else past of if else condition).&lt;/p&gt;
&lt;p&gt;Now observe below scenario, in that we are rewriting above 10 line code with another 10 line with if else and of course we are removing Try Catch also :)&lt;/p&gt;
&lt;h4&gt;Example 1 Scenario 2 : Without Try Catch&lt;/h4&gt;
&lt;pre class="brush: csharp"&gt;string strPrice = "abc";
int Price;           
Stopwatch sw = new Stopwatch();
sw.Start();

Int32.TryParse(strPrice, out Price);
if (Price == 0)
{
    // DO SOMETHING
}
else
{
    // DO SOMETHING
}

sw.Stop();
Console.WriteLine("CPU Ticks Used For Parsing : " + sw.ElapsedTicks.ToString());&lt;/pre&gt;
&lt;h4&gt;Output:&lt;/h4&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-TZA8T6hBHoY/Tt18pcMjSWI/AAAAAAAAAd4/rsaLUTa1ED8/s1600/TryCatch2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-TZA8T6hBHoY/Tt18pcMjSWI/AAAAAAAAAd4/rsaLUTa1ED8/s1600/TryCatch2.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;Volia!!! We have reduced CPU ticks from 42949 to 27.&lt;/p&gt;
&lt;p&gt;I don’t think that, I need to write more on scenario 2. It is self explanatory. Here the idea is that we should use Try Catch to handle exception only. In above example we are just parsing one string, but consider scenario where we are iterating through few thousands element or collection and where 90% or more elements are suppose to be string only and hence it goes in Catch block (Yes I faced the same situation!) After replacing Try Catch Block with If Else, I observed 10 times faster code than previous one.&lt;/p&gt;
&lt;p&gt;Now let see one more example for illustrative purpose.&lt;/p&gt;
&lt;h4&gt;Example2 Scenario 1 : With Try Catch&lt;/h4&gt;
&lt;pre class="brush: csharp"&gt;Stopwatch sw = new Stopwatch();
sw.Start();

FileStream fs;
try
{
    fs = File.Open("D:\\nandip.docx", FileMode.Open);
}
catch
{
    fs = File.Open("D:\\nandip.docx", FileMode.Create);
}

sw.Stop();
Console.WriteLine("CPU Ticks Used For Reading File : " + sw.ElapsedTicks.ToString());&lt;/pre&gt;
&lt;h4&gt;Output:&lt;/h4&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-DIdSkfFtoZA/Tt18pivSpOI/AAAAAAAAAeI/RXYGOVnKSok/s1600/TryCatch3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-DIdSkfFtoZA/Tt18pivSpOI/AAAAAAAAAeI/RXYGOVnKSok/s1600/TryCatch3.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h4&gt;Example 2 Scenario 2 : Without Try Catch&lt;/h4&gt;
&lt;pre class="brush: csharp"&gt;Stopwatch sw = new Stopwatch();
sw.Start();

if (File.Exists("D:\\nandip.docx"))
{
    fs = File.Open("D:\\nandip.docx", FileMode.Open);
}
else
{
    fs = File.Open("D:\\nandip.docx", FileMode.Create);
}

sw.Stop();
Console.WriteLine("CPU Ticks Used For Reading File : " + sw.ElapsedTicks.ToString());&lt;/pre&gt;
&lt;h4&gt;Output:&lt;/h4&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-POllwp_7GcA/Tt18qCrahpI/AAAAAAAAAeQ/veYH3H1hIZs/s1600/TryCatch4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-POllwp_7GcA/Tt18qCrahpI/AAAAAAAAAeQ/veYH3H1hIZs/s1600/TryCatch4.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;In above example also we can see CPU ticks reducing from 106668 to 1820. Idea behind above example is to show how to choose alternate solution where we fall in such situation or found in inherited code :)&lt;/p&gt;
&lt;p&gt;I hope two example discussed here, one real life example and one for illustrative purpose, would be helpful.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7819331473560289523-5837964201714754092?l=www.dotnetexpertguide.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/qWptuByS5et5oQu40L7qrut6JrE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qWptuByS5et5oQu40L7qrut6JrE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/qWptuByS5et5oQu40L7qrut6JrE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qWptuByS5et5oQu40L7qrut6JrE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=b6mskdIWeyk:AKeVfLq3w4I:iuKBeV4sXr0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=b6mskdIWeyk:AKeVfLq3w4I:iuKBeV4sXr0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=b6mskdIWeyk:AKeVfLq3w4I:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=b6mskdIWeyk:AKeVfLq3w4I:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=b6mskdIWeyk:AKeVfLq3w4I:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=b6mskdIWeyk:AKeVfLq3w4I:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=b6mskdIWeyk:AKeVfLq3w4I:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=b6mskdIWeyk:AKeVfLq3w4I:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=b6mskdIWeyk:AKeVfLq3w4I:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Dotnetexpertguide/~4/b6mskdIWeyk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.dotnetexpertguide.com/feeds/5837964201714754092/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.dotnetexpertguide.com/2011/12/efficiencies-use-of-try-catch-block.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/5837964201714754092?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/5837964201714754092?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Dotnetexpertguide/~3/b6mskdIWeyk/efficiencies-use-of-try-catch-block.html" title="Efficient Use of Try Catch Block" /><author><name>Nandip Makwana</name><uri>https://profiles.google.com/100983452498554383356</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-pDb4IK6WZRs/AAAAAAAAAAI/AAAAAAAAAf4/0K7LrsiXehI/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-PEEgU-UD-gQ/Tt18omIl_CI/AAAAAAAAAds/kLQJWns0jJc/s72-c/TryCatch1.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.dotnetexpertguide.com/2011/12/efficiencies-use-of-try-catch-block.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D04FQXY-eCp7ImA9WhdaGUk.&quot;"><id>tag:blogger.com,1999:blog-7819331473560289523.post-2243396270959341840</id><published>2011-10-30T09:08:00.000+05:30</published><updated>2011-10-30T09:08:30.850+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-30T09:08:30.850+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="URL Rewrite" /><category scheme="http://www.blogger.com/atom/ns#" term="IIS" /><category scheme="http://www.blogger.com/atom/ns#" term="SEO" /><category scheme="http://www.blogger.com/atom/ns#" term="IIS 7" /><title>Import Apache mod_rewrite Rules in IIS 7</title><content type="html">&lt;p&gt;With &lt;a target="_blank" href="http://learn.iis.net/page.aspx/24/running-php-applications-on-iis/"&gt;Microsoft's Web Stack&lt;/a&gt;, many PHP applications are now hosted on IIS. As PHP is an open source, one of the advantages of using PHP is that you will find plenty of free script for ready to use. And basically these all ready to use scripts are written for LAMP model, so we might face some problem related to web server (Apache vs IIS) configuration while running these scripts on IIS. Recently one of my friend face similar problem with Apache rewrite rules while he deployed ready to use PHP script on &lt;a target="_blank" href="http://www.arvixe.com/2455.html"&gt;IIS&lt;/a&gt;, and asked me to resolve it.&lt;/p&gt;
&lt;p&gt;We need to convert apache mod_rewrite rules into IIS URL Rewrite rules to deploy PHP application on &lt;a target="_blank" href="http://www.arvixe.com/2455.html"&gt;IIS&lt;/a&gt;. We can accomplish this task in two ways.&lt;/p&gt;
&lt;h4&gt;First way&lt;/h4&gt;
&lt;p&gt;Open .htaccess file of PHP and manually convert each apache mod_rewrite rule in IIS URL Rewrite rule and then save it in web.config. Now loop through above process for total number of apache mod_rewrite rule ;)&lt;/p&gt;
&lt;h4&gt;Smarter way&lt;/h4&gt;
&lt;p&gt;Instead of manually loop through each apache mod_rewrite rule and converting it in IIS URL Rewrite rule, we can automate this process with &lt;a target="_blank" href="http://www.iis.net/download/URLRewrite"&gt;IIS URL Rewrite Module&lt;/a&gt;. &lt;a href="http://www.dotnetexpertguide.com/2011/08/iis-7-redirect-domaincom-to.html"&gt;Earlier in one post we have seen how we can use IIS URL Rewrite Module to set preferred domain&lt;/a&gt;. Following is the steps for converting apache mod_rewrite rules into IIS URL Rewrite rules.&lt;/p&gt;
&lt;p&gt;Open URL Rewrite Module in IIS.&lt;/p&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-YUN4MtLE0OI/TqzAx6wYY6I/AAAAAAAAAaU/G_YvOGyQ22c/s1600/1.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="282" width="320" src="http://2.bp.blogspot.com/-YUN4MtLE0OI/TqzAx6wYY6I/AAAAAAAAAaU/G_YvOGyQ22c/s320/1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;In Actions pane of right side, click on import rules. It will open Import mod_rewrite rules screen.&lt;/p&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-hqO4cm2CTjk/TqzAyC-ivKI/AAAAAAAAAac/YDmEwwxQJNU/s1600/2.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="302" width="201" src="http://1.bp.blogspot.com/-hqO4cm2CTjk/TqzAyC-ivKI/AAAAAAAAAac/YDmEwwxQJNU/s320/2.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;Browse through .htaccess file and click on import button.&lt;/p&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-8u7eUBv2zRI/TqzAyFG4pwI/AAAAAAAAAas/nRnrXJXa2aw/s1600/4.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="302" width="320" src="http://3.bp.blogspot.com/-8u7eUBv2zRI/TqzAyFG4pwI/AAAAAAAAAas/nRnrXJXa2aw/s320/4.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;You can see summary of converted rules in tree view. You can also verify converted rules in XML view.&lt;/p&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-eXZoiBUOboY/TqzAyhlzO8I/AAAAAAAAAa8/G5s8o7Oz7IY/s1600/6.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="147" width="320" src="http://4.bp.blogspot.com/-eXZoiBUOboY/TqzAyhlzO8I/AAAAAAAAAa8/G5s8o7Oz7IY/s320/6.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;After verifying each rule click on apply in Actions pane.&lt;/p&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-i8cGtJitGus/TqzAy4Q07gI/AAAAAAAAAbE/CxIFkrkg_dE/s1600/7.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="145" width="150" src="http://2.bp.blogspot.com/-i8cGtJitGus/TqzAy4Q07gI/AAAAAAAAAbE/CxIFkrkg_dE/s320/7.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;That’s it, you have done. Now your all apache mod_rewrite rules are converted in IIS URL Rewrite rule and saved in web.config.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7819331473560289523-2243396270959341840?l=www.dotnetexpertguide.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/MhPY_gbP8OOTx6N1OYtSECY23K8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MhPY_gbP8OOTx6N1OYtSECY23K8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/MhPY_gbP8OOTx6N1OYtSECY23K8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MhPY_gbP8OOTx6N1OYtSECY23K8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=Rxeq4sAaCWQ:XLtXhRwxArg:iuKBeV4sXr0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=Rxeq4sAaCWQ:XLtXhRwxArg:iuKBeV4sXr0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=Rxeq4sAaCWQ:XLtXhRwxArg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=Rxeq4sAaCWQ:XLtXhRwxArg:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=Rxeq4sAaCWQ:XLtXhRwxArg:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=Rxeq4sAaCWQ:XLtXhRwxArg:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=Rxeq4sAaCWQ:XLtXhRwxArg:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=Rxeq4sAaCWQ:XLtXhRwxArg:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=Rxeq4sAaCWQ:XLtXhRwxArg:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Dotnetexpertguide/~4/Rxeq4sAaCWQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.dotnetexpertguide.com/feeds/2243396270959341840/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.dotnetexpertguide.com/2011/10/import-apache-modrewrite-rules-iis-7.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/2243396270959341840?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/2243396270959341840?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Dotnetexpertguide/~3/Rxeq4sAaCWQ/import-apache-modrewrite-rules-iis-7.html" title="Import Apache mod_rewrite Rules in IIS 7" /><author><name>Nandip Makwana</name><uri>https://profiles.google.com/100983452498554383356</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-pDb4IK6WZRs/AAAAAAAAAAI/AAAAAAAAAf4/0K7LrsiXehI/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-YUN4MtLE0OI/TqzAx6wYY6I/AAAAAAAAAaU/G_YvOGyQ22c/s72-c/1.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.dotnetexpertguide.com/2011/10/import-apache-modrewrite-rules-iis-7.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkcARn8-cSp7ImA9WhRVFUw.&quot;"><id>tag:blogger.com,1999:blog-7819331473560289523.post-2297994535126757071</id><published>2011-10-30T09:03:00.000+05:30</published><updated>2012-01-14T09:37:27.159+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-14T09:37:27.159+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="IIS" /><category scheme="http://www.blogger.com/atom/ns#" term="IIS 7" /><title>IIS 7 Tutorial Posts Link</title><content type="html">&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-NFaCxlx01Z4/TqzEidMP0EI/AAAAAAAAAbQ/b7iTa4KMF6c/s1600/welcome.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="71" src="http://3.bp.blogspot.com/-NFaCxlx01Z4/TqzEidMP0EI/AAAAAAAAAbQ/b7iTa4KMF6c/s200/welcome.png" width="150" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;This page keep tracks of tutorial post link on IIS administrations and configurations.&lt;/p&gt;&lt;br/&gt;&lt;br/&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a target="_blank" href="http://www.dotnetexpertguide.com/2012/01/installing-and-running-nodejs-iisnode.html"&gt;Installing and Running node.js application with iisnode&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a target="_blank" href="http://www.dotnetexpertguide.com/2011/10/import-apache-modrewrite-rules-iis-7.html"&gt;Import Apache mod_rewrite Rules in IIS 7&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a target="_blank" href="http://www.dotnetexpertguide.com/2011/08/iis-7-redirect-domaincom-to.html"&gt;IIS 7 : Redirect domain.com to www.domain.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a target="_blank" href="http://www.dotnetexpertguide.com/2011/08/connect-to-remote-site-through-remote.html"&gt;Connect to remote site through remote IIS manager&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7819331473560289523-2297994535126757071?l=www.dotnetexpertguide.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ghDRk6-VjPMpBBe7tTmZ0He1zU0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ghDRk6-VjPMpBBe7tTmZ0He1zU0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ghDRk6-VjPMpBBe7tTmZ0He1zU0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ghDRk6-VjPMpBBe7tTmZ0He1zU0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=cyY8CUANqrU:Zcpa1kHc_X8:iuKBeV4sXr0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=cyY8CUANqrU:Zcpa1kHc_X8:iuKBeV4sXr0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=cyY8CUANqrU:Zcpa1kHc_X8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=cyY8CUANqrU:Zcpa1kHc_X8:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=cyY8CUANqrU:Zcpa1kHc_X8:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=cyY8CUANqrU:Zcpa1kHc_X8:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=cyY8CUANqrU:Zcpa1kHc_X8:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=cyY8CUANqrU:Zcpa1kHc_X8:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=cyY8CUANqrU:Zcpa1kHc_X8:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Dotnetexpertguide/~4/cyY8CUANqrU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.dotnetexpertguide.com/feeds/2297994535126757071/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.dotnetexpertguide.com/2011/10/iis-7-tutorial-posts-link.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/2297994535126757071?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/2297994535126757071?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Dotnetexpertguide/~3/cyY8CUANqrU/iis-7-tutorial-posts-link.html" title="IIS 7 Tutorial Posts Link" /><author><name>Nandip Makwana</name><uri>https://profiles.google.com/100983452498554383356</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-pDb4IK6WZRs/AAAAAAAAAAI/AAAAAAAAAf4/0K7LrsiXehI/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-NFaCxlx01Z4/TqzEidMP0EI/AAAAAAAAAbQ/b7iTa4KMF6c/s72-c/welcome.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.dotnetexpertguide.com/2011/10/iis-7-tutorial-posts-link.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0cAQns5cSp7ImA9WhdaEkw.&quot;"><id>tag:blogger.com,1999:blog-7819331473560289523.post-2930774291400135110</id><published>2011-10-21T08:04:00.000+05:30</published><updated>2011-10-21T23:14:03.529+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-21T23:14:03.529+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="CTP" /><category scheme="http://www.blogger.com/atom/ns#" term="C-Sharp" /><category scheme="http://www.blogger.com/atom/ns#" term="Visual Studio" /><category scheme="http://www.blogger.com/atom/ns#" term="Roslyn" /><title>Build Online C# Syntax Checker with Roslyn</title><content type="html">&lt;p&gt;On 19th Oct, Microsoft released first Community Technology Preview of the &lt;a target="_blank" href="http://blogs.msdn.com/b/visualstudio/archive/2011/10/19/introducing-the-microsoft-roslyn-ctp.aspx"&gt;Roslyn Project&lt;/a&gt;. With the release of &lt;a target="_blank" href="http://msdn.com/roslyn"&gt;Roslyn&lt;/a&gt; Project, First time Microsoft is opening up the C# and Visual Basic compilers through &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/hh500769"&gt;Rich Roslyn API&lt;/a&gt;. More detail about Core API and others feature of October CTP released can be found &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/hh500769"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;As far as the web development concerns, Possibilities are lot increased with Roslyn project. In future we might see web application for online syntax checker-formatter, online code compiler (Upload code and download dll / assembly!!!), and might even whole online IDE based on SaaS model!!!&lt;/p&gt;
&lt;p&gt;Possibilities are endless. Here we will see how we can create online C# syntax checker with the help of &lt;b&gt;Roslyn.Compilers.CSharp.DiagnosticList&lt;/b&gt; class.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;NOTE:&lt;/b&gt; Please note that Roslyn Project is a still in technology preview and there are known issues and only a subset of the VB and C# languages has been implemented at this time.&lt;/p&gt;
&lt;p&gt;Create new web application with Roslyn (See my post on &lt;a href="http://www.dotnetexpertguide.com/2011/10/setup-net-project-with-roslyn.html"&gt;how to setup .NET project with Roslyn&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;In default.aspx add one textbox, button, and label as below. And on button click event write following code.&lt;/p&gt;
&lt;p&gt;
&lt;pre class="brush: csharp"&gt;protected void btnCheck_Click(object sender, EventArgs e)
{
    string strDetail = "";
    Diagnostic obj;
    var tree = SyntaxTree.ParseCompilationUnit(txtSyntax.Text);

    if (tree.GetDiagnostics().Count == 0)
    {
        strDetail += "Diagnostic test passed!!!";
    }

    for (int i = 0; i &amp;lt; tree.GetDiagnostics().Count; i++)
    {
        obj = tree.GetDiagnostics()[i];
        strDetail += "&amp;lt;b&amp;gt;" + (i + 1).ToString() + ". Info: &amp;lt;/b&amp;gt;" + obj.Info.ToString();
        strDetail += " &amp;lt;b&amp;gt;Warning Level: &amp;lt;/b&amp;gt;" + obj.Info.WarningLevel.ToString();
        strDetail += " &amp;lt;b&amp;gt;Severity Level: &amp;lt;/b&amp;gt;" + obj.Info.Severity.ToString() + "&amp;lt;br/&amp;gt;";
        strDetail += " &amp;lt;b&amp;gt;Location: &amp;lt;/b&amp;gt;" + obj.Location.Kind.ToString();
        strDetail += " &amp;lt;b&amp;gt;Character at: &amp;lt;/b&amp;gt;" + obj.Location.GetLineSpan(true).StartLinePosition.Character.ToString();
        strDetail += " &amp;lt;b&amp;gt;On Line: &amp;lt;/b&amp;gt;" + obj.Location.GetLineSpan(true).StartLinePosition.Line.ToString();
        strDetail += "&amp;lt;/br&amp;gt;";                
    }            

    lblResult.Text = strDetail;
}
&lt;/pre&gt;
&lt;/p&gt;
&lt;h4&gt;Code Explanation&lt;/h4&gt;
&lt;p&gt;&lt;b&gt;DiagnosticList&lt;/b&gt; is a collection or list of &lt;b&gt;Diagnostic&lt;/b&gt; class gives information which can be helpful to diagnosis any error if there is. &lt;b&gt;Diagnostic.Info&lt;/b&gt; property gives various information which is helpful in diagnosis. For e.g.  Error code, Warning Level, Severity Level, Message, etc. whereas &lt;b&gt;Diagnostic.Location&lt;/b&gt; property give information which can be helpful to identify error location. For e.g. line no, character position, source file or metadata error and lot more.&lt;/p&gt;
&lt;h4&gt;Sample Output&lt;/h4&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-JRlgud9-1ts/TqDZEX2zxvI/AAAAAAAAAZc/ajU3vqjNqQo/s1600/Roslyn-1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-JRlgud9-1ts/TqDZEX2zxvI/AAAAAAAAAZc/ajU3vqjNqQo/s1600/Roslyn-1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-qC1gmdTTptA/TqDZEhUAl8I/AAAAAAAAAZk/CTniLDwinUU/s1600/Roslyn-2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-qC1gmdTTptA/TqDZEhUAl8I/AAAAAAAAAZk/CTniLDwinUU/s1600/Roslyn-2.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-im-wzXsa60E/TqDZEhBER9I/AAAAAAAAAZw/7W4fQdS9HfU/s1600/Roslyn-3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-im-wzXsa60E/TqDZEhBER9I/AAAAAAAAAZw/7W4fQdS9HfU/s1600/Roslyn-3.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7819331473560289523-2930774291400135110?l=www.dotnetexpertguide.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/W_mFNs8vSbXtNOiMKeh9OAJzbrY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/W_mFNs8vSbXtNOiMKeh9OAJzbrY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/W_mFNs8vSbXtNOiMKeh9OAJzbrY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/W_mFNs8vSbXtNOiMKeh9OAJzbrY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=WWJNXVyUBRc:R7Q0pLedVic:iuKBeV4sXr0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=WWJNXVyUBRc:R7Q0pLedVic:iuKBeV4sXr0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=WWJNXVyUBRc:R7Q0pLedVic:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=WWJNXVyUBRc:R7Q0pLedVic:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=WWJNXVyUBRc:R7Q0pLedVic:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=WWJNXVyUBRc:R7Q0pLedVic:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=WWJNXVyUBRc:R7Q0pLedVic:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=WWJNXVyUBRc:R7Q0pLedVic:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=WWJNXVyUBRc:R7Q0pLedVic:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Dotnetexpertguide/~4/WWJNXVyUBRc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.dotnetexpertguide.com/feeds/2930774291400135110/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.dotnetexpertguide.com/2011/10/c-sharp-syntax-checker-aspnet-roslyn.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/2930774291400135110?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/2930774291400135110?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Dotnetexpertguide/~3/WWJNXVyUBRc/c-sharp-syntax-checker-aspnet-roslyn.html" title="Build Online C# Syntax Checker with Roslyn" /><author><name>Nandip Makwana</name><uri>https://profiles.google.com/100983452498554383356</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-pDb4IK6WZRs/AAAAAAAAAAI/AAAAAAAAAf4/0K7LrsiXehI/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-JRlgud9-1ts/TqDZEX2zxvI/AAAAAAAAAZc/ajU3vqjNqQo/s72-c/Roslyn-1.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.dotnetexpertguide.com/2011/10/c-sharp-syntax-checker-aspnet-roslyn.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUUARn0zfyp7ImA9WhdaEUs.&quot;"><id>tag:blogger.com,1999:blog-7819331473560289523.post-9209478653251873441</id><published>2011-10-21T07:44:00.000+05:30</published><updated>2011-10-21T07:44:07.387+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-21T07:44:07.387+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="CTP" /><category scheme="http://www.blogger.com/atom/ns#" term="C-Sharp" /><category scheme="http://www.blogger.com/atom/ns#" term="Visual Studio" /><category scheme="http://www.blogger.com/atom/ns#" term="Roslyn" /><title>Setup .NET Project with Roslyn</title><content type="html">&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-LLQ3iN4aiI0/TqDVBmXiTwI/AAAAAAAAAZQ/wuV5mGDSsTk/s1600/Visual%2BStudio.png" imageanchor="1" style="clear:left; float:left;margin-right:1em; margin-bottom:1em"&gt;&lt;img border="0" height="178" width="233" src="http://3.bp.blogspot.com/-LLQ3iN4aiI0/TqDVBmXiTwI/AAAAAAAAAZQ/wuV5mGDSsTk/s320/Visual%2BStudio.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;Yesterday Microsoft released first Community Technology Preview of the &lt;a target="_blank" href="http://blogs.msdn.com/b/visualstudio/archive/2011/10/19/introducing-the-microsoft-roslyn-ctp.aspx"&gt;Roslyn Project&lt;/a&gt;. With the release of &lt;a target="_blank" href="http://msdn.com/roslyn"&gt;Roslyn&lt;/a&gt; Project, First time Microsoft is opening up the C# and Visual Basic compilers through &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/hh500769"&gt;Rich Roslyn API&lt;/a&gt;. More detail about Core API and others feature of October CTP released can be found here.&lt;/p&gt;
&lt;p&gt;In this post we will see how to setup .NET project with Roslyn.&lt;/p&gt;&lt;br/&gt;&lt;br/&gt;
&lt;h4&gt;Prerequisite &lt;/h4&gt;
&lt;p&gt;Visual Studio 2010 SP1 SDK (&lt;a target="_blank" href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;id=21835"&gt;Download it here&lt;/a&gt;) &lt;br/&gt;
Microsoft “Roslyn” CTP (&lt;a target="_blank" href="http://www.microsoft.com/download/en/details.aspx?id=27746"&gt;Download it here&lt;/a&gt;)&lt;/p&gt;
&lt;h4&gt;Setup Project with Roslyn&lt;/h4&gt;
&lt;p&gt;Create new project (Web / Console / Windows)&lt;/p&gt;
&lt;p&gt;From Project menu click on &lt;b&gt;Add Reference&lt;/b&gt;, it will open Add Reference dialog box.&lt;/p&gt;
&lt;p&gt;You need to add reference to &lt;b&gt;Roslyn.Compilers&lt;/b&gt; and &lt;b&gt;Roslyn.Services.CSharp&lt;/b&gt; or &lt;b&gt;Roslyn.Compilers.VisualBasic&lt;/b&gt; depending upon your project language C# or Visual Basic.&lt;/p&gt;
&lt;p&gt;You can find these assemble under .NET tab of Add Reference dialog. Add reference to appropriate assembly as listed above.&lt;/p&gt;
&lt;p&gt;In case if you do not find above assembly under .NET tab then navigate to Browse tab and look in &lt;b&gt;C:\Program Files\Reference Assemblies\Microsoft\Roslyn\v1.0&lt;/b&gt; directory. By default all Roslyn assembly are placed at that location.&lt;/p&gt;
&lt;p&gt;That’s it, you have done!!! You can now leverage the &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/hh500769"&gt;rich Roslyn API&lt;/a&gt; to build application or extensions based on Roslyn.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7819331473560289523-9209478653251873441?l=www.dotnetexpertguide.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/KG0S4HPi2bESe96v3Dwxo9vnJvM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KG0S4HPi2bESe96v3Dwxo9vnJvM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/KG0S4HPi2bESe96v3Dwxo9vnJvM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KG0S4HPi2bESe96v3Dwxo9vnJvM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=99VDDkqjfUI:PFKvCehWlOA:iuKBeV4sXr0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=99VDDkqjfUI:PFKvCehWlOA:iuKBeV4sXr0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=99VDDkqjfUI:PFKvCehWlOA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=99VDDkqjfUI:PFKvCehWlOA:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=99VDDkqjfUI:PFKvCehWlOA:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=99VDDkqjfUI:PFKvCehWlOA:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=99VDDkqjfUI:PFKvCehWlOA:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=99VDDkqjfUI:PFKvCehWlOA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=99VDDkqjfUI:PFKvCehWlOA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Dotnetexpertguide/~4/99VDDkqjfUI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.dotnetexpertguide.com/feeds/9209478653251873441/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.dotnetexpertguide.com/2011/10/setup-net-project-with-roslyn.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/9209478653251873441?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/9209478653251873441?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Dotnetexpertguide/~3/99VDDkqjfUI/setup-net-project-with-roslyn.html" title="Setup .NET Project with Roslyn" /><author><name>Nandip Makwana</name><uri>https://profiles.google.com/100983452498554383356</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-pDb4IK6WZRs/AAAAAAAAAAI/AAAAAAAAAf4/0K7LrsiXehI/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-LLQ3iN4aiI0/TqDVBmXiTwI/AAAAAAAAAZQ/wuV5mGDSsTk/s72-c/Visual%2BStudio.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.dotnetexpertguide.com/2011/10/setup-net-project-with-roslyn.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0UARHg-fSp7ImA9WhRTFU0.&quot;"><id>tag:blogger.com,1999:blog-7819331473560289523.post-1647783847377522115</id><published>2011-09-27T01:33:00.000+05:30</published><updated>2011-11-05T21:37:25.655+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-05T21:37:25.655+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MVC" /><category scheme="http://www.blogger.com/atom/ns#" term="MVC 4" /><title>Under the Hood of Display Mode in MVC 4</title><content type="html">&lt;p&gt;This post is part of &lt;a href="http://www.dotnetexpertguide.com/2011/09/aspnet-mvc-4-article-series.html" target="_blank"&gt;ASP.NET MVC 4 Article Series&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I am little late in publishing this post as I was busy with my 1st &lt;a target="_blank" href="http://mvcsocialhelper.codeplex.com/"&gt;codeplex project&lt;/a&gt;. Very soon I will post about my 1st &lt;a target="_blank" href="http://mvcsocialhelper.codeplex.com/"&gt;codeplex project&lt;/a&gt;. Till that, enjoy this MVC 4 series and do let me know your valuable feedback.&lt;/p&gt;
&lt;p&gt;In our &lt;a href="http://www.dotnetexpertguide.com/2011/09/display-mode-in-mvc-4aspnet-mvc-4.html" target="_blank"&gt;last post&lt;/a&gt;, we have seen how we can use Display Mode feature of MVC 4 to enable browser specific view. In this post we will examine how in built Display Mode works in MVC 4.&lt;/p&gt;
&lt;p&gt;We know that we can create view for mobile browser by adding &lt;b&gt;.mobile&lt;/b&gt; suffix in view name. For e.g. &lt;b&gt;index.mobile.cshtml&lt;/b&gt;. And this mobile view will be automatically rendered in mobile browser and we also know &lt;a href="http://www.dotnetexpertguide.com/2011/09/display-mode-in-mvc-4aspnet-mvc-4.html"&gt;how to add new Display Mode in MVC 4 application&lt;/a&gt; &lt;b&gt;but the question is that we have not added any Display Mode for .mobile suffix than also how it is rendered automatically in mobile browser. We will try to debug it in this post.&lt;/b&gt;&lt;/p&gt;
&lt;h4&gt;Get started for the Learn with Fun&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Create a new MVC 4 application.&lt;/li&gt;
&lt;li&gt;Open &lt;b&gt;Global.asax.cs&lt;/b&gt; and put break point on &lt;b&gt;Application_Start&lt;/b&gt; as displayed in below image.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-xbIrziPpzLY/ToDUO3BxezI/AAAAAAAAAW0/RwbzF97pges/s1600/1_App_start.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-xbIrziPpzLY/ToDUO3BxezI/AAAAAAAAAW0/RwbzF97pges/s1600/1_App_start.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Now press &lt;b&gt;F5&lt;/b&gt; and wait till break point hit.&lt;/li&gt;
&lt;li&gt;Now open &lt;b&gt;Immediate Window&lt;/b&gt; and type as shown below.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-zl-nggz0dnk/ToDUYgM-5DI/AAAAAAAAAW8/IOz2HDhGARo/s1600/2_mode_count.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-zl-nggz0dnk/ToDUYgM-5DI/AAAAAAAAAW8/IOz2HDhGARo/s1600/2_mode_count.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;As you can see the value of &lt;b&gt;System.Web.WebPages.DisplayModes.Modes.Count&lt;/b&gt; is &lt;b&gt;2&lt;/b&gt; which mean there are two in built Display Mode in MVC 4 application. Let take it further to know more about these two in built Display Mode.&lt;/li&gt;
&lt;li&gt;First of all stop debugging by pressing &lt;b&gt;Shift + F5&lt;/b&gt; and import &lt;b&gt;System.Web.WebPages&lt;/b&gt; namespace at the top of &lt;b&gt;Global.asax.cs&lt;/b&gt; file so we need not to write full qualified name in debugging process.&lt;/li&gt;
&lt;li&gt;Now again press &lt;b&gt;F5&lt;/b&gt; and wait till break point hit.&lt;/li&gt;
&lt;li&gt;Type following in the &lt;b&gt;Immediate Window&lt;/b&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-UqZAZ1gt-oY/ToDUwIPjgrI/AAAAAAAAAXE/C4fdK5rWrog/s1600/3_default_1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-UqZAZ1gt-oY/ToDUwIPjgrI/AAAAAAAAAXE/C4fdK5rWrog/s1600/3_default_1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;We have tried to create instance of &lt;b&gt;DefaultDisplayMode&lt;/b&gt; class and assigned it with Display Mode at 0th position. Examining its &lt;b&gt;DisplayModeId&lt;/b&gt; properties, we found that its value is &lt;b&gt;Mobile&lt;/b&gt; and hence this Display Mode is responsible for rendering mobile view in mobile browser. Examining &lt;b&gt;ContextCondition&lt;/b&gt; properties, we found that it reference the &lt;b&gt;&amp;lt;.cctor&amp;gt;b__b(System.Web.HttpContextBase)&lt;/b&gt; method and hence this method is responsible for validating current request context that whether it is from mobile browser or not (We will also dig into this method at later in this post).&lt;/p&gt;
&lt;p&gt;Same way let also inspect Display Mode at 1st position just as we inspected of 0th position. Type following in the &lt;b&gt;Immediate Window&lt;/b&gt;.&lt;/p&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-z-BAm6e8fNs/ToDVMho_eAI/AAAAAAAAAXM/QTEZ_2QznIc/s1600/4_default_2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-z-BAm6e8fNs/ToDVMho_eAI/AAAAAAAAAXM/QTEZ_2QznIc/s1600/4_default_2.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;As we can see in Immediate Window that &lt;b&gt;DisplayModeId&lt;/b&gt; is set to blank or empty and &lt;b&gt;ContextCondition&lt;/b&gt; is set to null which means if all preceding Display Mode’s ContextCondition fail at that time this Display Mode will be taken in consider. &lt;b&gt;So keep patient while adding Display Mode with null ContextCondition and make sure you add it after adding all other Display Mode otherwise succeeding Display Mode will never taken in consideration.&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;In earlier in this post, while we examined Display Mode at 0th position at that time we noticed that &lt;b&gt;&amp;lt;.cctor&amp;gt;b__b(System.Web.HttpContextBase)&lt;/b&gt; method is responsible for validating current request context. To dig more on this method do as follow.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Open &lt;b&gt;Visual Studio Command Prompt&lt;/b&gt; and type &lt;b&gt;ildasm&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Open &lt;b&gt;System.Web.WebPages.dll&lt;/b&gt; and navigate to &lt;b&gt;&amp;lt;.cctor&amp;gt;b__b(System.Web.HttpContextBase)&lt;/b&gt; method under &lt;b&gt;System.Web.WebPages.DisplayModes&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Now double clicking on method name will open a new window.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-cTaaarGAFzk/ToDVo5ih2ZI/AAAAAAAAAXU/srLy159s3hg/s1600/5_DASM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-cTaaarGAFzk/ToDVo5ih2ZI/AAAAAAAAAXU/srLy159s3hg/s1600/5_DASM.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;Examining code in that window you will find that it is detecting mobile browser with &lt;b&gt;System.Web.HttpBrowserCapabilitiesBase::get_IsMobileDevice()&lt;/b&gt; which is equivalent to C# &lt;b&gt;Request.Browser.IsMobileDevice&lt;/b&gt;.&lt;/p&gt;
So in this post, we tried to examine in built Display Mode of MVC 4. Hope this post would be helpful.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7819331473560289523-1647783847377522115?l=www.dotnetexpertguide.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/vbFtPYz9CdJjDTV0RfCPzdzlB2g/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vbFtPYz9CdJjDTV0RfCPzdzlB2g/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/vbFtPYz9CdJjDTV0RfCPzdzlB2g/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vbFtPYz9CdJjDTV0RfCPzdzlB2g/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=OMsTI-8ANRc:j-Vd7-IxE80:iuKBeV4sXr0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=OMsTI-8ANRc:j-Vd7-IxE80:iuKBeV4sXr0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=OMsTI-8ANRc:j-Vd7-IxE80:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=OMsTI-8ANRc:j-Vd7-IxE80:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=OMsTI-8ANRc:j-Vd7-IxE80:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=OMsTI-8ANRc:j-Vd7-IxE80:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=OMsTI-8ANRc:j-Vd7-IxE80:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=OMsTI-8ANRc:j-Vd7-IxE80:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=OMsTI-8ANRc:j-Vd7-IxE80:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Dotnetexpertguide/~4/OMsTI-8ANRc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.dotnetexpertguide.com/feeds/1647783847377522115/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.dotnetexpertguide.com/2011/09/under-hood-of-display-mode-mvc-4.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/1647783847377522115?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/1647783847377522115?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Dotnetexpertguide/~3/OMsTI-8ANRc/under-hood-of-display-mode-mvc-4.html" title="Under the Hood of Display Mode in MVC 4" /><author><name>Nandip Makwana</name><uri>https://profiles.google.com/100983452498554383356</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-pDb4IK6WZRs/AAAAAAAAAAI/AAAAAAAAAf4/0K7LrsiXehI/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-xbIrziPpzLY/ToDUO3BxezI/AAAAAAAAAW0/RwbzF97pges/s72-c/1_App_start.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.dotnetexpertguide.com/2011/09/under-hood-of-display-mode-mvc-4.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkcGSHkyfCp7ImA9WhdUEEs.&quot;"><id>tag:blogger.com,1999:blog-7819331473560289523.post-1711369626803168798</id><published>2011-09-21T23:09:00.000+05:30</published><updated>2011-09-27T01:43:49.794+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-27T01:43:49.794+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MVC" /><category scheme="http://www.blogger.com/atom/ns#" term="MVC 4" /><title>Display Mode in ASP.NET MVC 4</title><content type="html">&lt;p&gt;This post is part of &lt;a href="http://www.dotnetexpertguide.com/2011/09/aspnet-mvc-4-article-series.html" target="_blank"&gt;ASP.NET MVC 4 Article Series&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In &lt;a href="http://www.dotnetexpertguide.com/2011/09/aspnet-mvc-4-mobile-project-template.html"&gt;previous post&lt;/a&gt;, we learnt how to get started with MVC 4 Mobile Project which target mobile or tablet device. Then after you can host this application to separate sub domain and redirect your mobile or tablet device visitor to that mobile application. In this post, we will learn how to develop a MVC 4 application which target desktop browser as well mobile or tablet device without redirecting to separate mobile application.&lt;/p&gt;
&lt;p&gt;MVC 4 introduces a new &lt;a href="http://www.dotnetexpertguide.com/2011/09/under-hood-of-display-mode-mvc-4.html" target="_blank"&gt;Display Mode&lt;/a&gt; feature which enables us to create different version of view and it will select appropriate view version based on requesting browser. For e.g. if desktop browser is requesting home page then it can render &lt;b&gt;Views\Home\Homepage.cshtml&lt;/b&gt; and if the mobile or tablet browser request home page then it can render &lt;b&gt;Views\Home\Homepage.Mobile.cshtml&lt;/b&gt; without changing URL of the application.&lt;/p&gt;
&lt;p&gt;We can also have different version for layout and partial view. So whenever desktop browser will make request at that time it will use &lt;b&gt;Views\Shared\_Layout.cshtml&lt;/b&gt; and if mobile or tablet browser is making request at that time it will use &lt;b&gt;Views\Shared\_Layout.Mobile.cshtml&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;In addition to layout view, same strategy also applies for partial vie. For e.g. @Html.Partial(“Login”) will render login.cshtml if requesting browser is desktop otherwise it will render login.Mobile.cshtml if request is made by mobile browser.&lt;/p&gt;
&lt;h4&gt;How Display Mode works&lt;/h4&gt;
&lt;p&gt;To get started with different view version, you need to register each view version name in &lt;b&gt;Application_Start&lt;/b&gt; event of the &lt;b&gt;global.asax.cs&lt;/b&gt;. So later on application can select appropriate view version when browser request satisfies certain conditions.&lt;/p&gt;
&lt;p&gt;We can register a new display mode or view version with the &lt;b&gt;DefaultDisplayMode&lt;/b&gt; class and we need to assign Display Mode name and condition when to apply this Display Mode. For e.g. following code snippet register a display mode “&lt;b&gt;Mobile&lt;/b&gt;” which will used whenever any mobile browser make a request.&lt;/p&gt;
&lt;pre class="brush: csharp"&gt;
protected void Application_Start()
{
        System.Func&amp;lt;HttpContextBase, bool&amp;gt; contextCheckDelegate = contextCheck;
        DefaultDisplayMode mobileMode = new DefaultDisplayMode("Mobile");
        mobileMode.ContextCondition = contextCheckDelegate;
        DisplayModes.Modes.Add(mobileMode);
}

public bool contextCheck(HttpContextBase objHttpContextBase)
{
	If(IsMobileBrowser)
		Return true;
	Else
		Return false;
}
&lt;/pre&gt;
&lt;p&gt;In above code, we have seen that &lt;b&gt;ContextCondition&lt;/b&gt; properties of &lt;b&gt;DefaultDisplayMode&lt;/b&gt; accept a delegate so we can register a more than one Display Mode with the application.&lt;/p&gt;
&lt;p&gt;Now have a quick look at sample application for Display Mode.&lt;/p&gt;
&lt;h4&gt;Sample application with MVC 4 which target desktop as well mobile device&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Create a new MVC 4 application&lt;/li&gt;
&lt;li&gt;Now in the Views\Home folder and Views\Shared add new views (You can even add existing views which we created with Mobile Project Template and then rename it as shown in the following picture. So you do not need bother about layout and designing for Mobile views) as displayed in following picture.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-zBcDMrojbuQ/TnocZSshl0I/AAAAAAAAAWI/Ni3qIlTzowo/s1600/Views.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="312" width="269" src="http://3.bp.blogspot.com/-zBcDMrojbuQ/TnocZSshl0I/AAAAAAAAAWI/Ni3qIlTzowo/s320/Views.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Now add following code in the &lt;b&gt;Application_Start&lt;/b&gt; event of the &lt;b&gt;global.asax.cs&lt;/b&gt; (You can download full Regular expression to detect mobile browser from the &lt;a href="http://detectmobilebrowsers.com/" target="_blank"&gt;http://detectmobilebrowsers.com/&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class="brush: csharp"&gt;
protected void Application_Start()
{
        System.Func&amp;lt;HttpContextBase, bool&amp;gt; contextCheckDelegate = contextCheck;
        DefaultDisplayMode mobileMode = new DefaultDisplayMode("Mobile");
        mobileMode.ContextCondition = contextCheckDelegate;
        DisplayModes.Modes.Add(mobileMode);
}

public bool contextCheck(HttpContextBase objHttpContextBase)
{
        string strUserAgent = objHttpContextBase.Request.UserAgent;
        Regex strBrowser = new Regex(@"android.+mobile|blackberry|ip(hone|od)", RegexOptions.IgnoreCase | RegexOptions.Multiline);
        if ((strBrowser.IsMatch(strUserAgent)))
        {
            return true;
        }
        return false;
}
&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Build the project and views it in browser by pressing &lt;b&gt;Ctrl + F5&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Now open same URL with any mobile emulator or you can even use Mozilla with &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/user-agent-switcher/" target="_blank"&gt;Mozilla User Agent Switcher Add-ons&lt;/a&gt;. I am using User Agent Switcher. Switch user agent to iPhone and now press F5. You will see the mobile index.mobile.cshtml view rendered.&lt;/li&gt;
&lt;/ul&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-m7l1HCqxqrE/TnofspjpleI/AAAAAAAAAWQ/eclaAYae3dA/s1600/about.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="310" width="320" src="http://4.bp.blogspot.com/-m7l1HCqxqrE/TnofspjpleI/AAAAAAAAAWQ/eclaAYae3dA/s320/about.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-z9_Kg-XhHWw/Tnofshu8ztI/AAAAAAAAAWY/eLMzY9OiJ0w/s1600/about.mobile.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="320" width="286" src="http://3.bp.blogspot.com/-z9_Kg-XhHWw/Tnofshu8ztI/AAAAAAAAAWY/eLMzY9OiJ0w/s320/about.mobile.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;In above scenario, note the address bar of the browser in both case, you will notice that address bar remains same even if it render different view based on requesting browser.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7819331473560289523-1711369626803168798?l=www.dotnetexpertguide.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/wh2YyRy6XMywj3QekCVJgqNrPnY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/wh2YyRy6XMywj3QekCVJgqNrPnY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/wh2YyRy6XMywj3QekCVJgqNrPnY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/wh2YyRy6XMywj3QekCVJgqNrPnY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=rnE2VzpNys0:Ta-Me6JCcKc:iuKBeV4sXr0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=rnE2VzpNys0:Ta-Me6JCcKc:iuKBeV4sXr0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=rnE2VzpNys0:Ta-Me6JCcKc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=rnE2VzpNys0:Ta-Me6JCcKc:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=rnE2VzpNys0:Ta-Me6JCcKc:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=rnE2VzpNys0:Ta-Me6JCcKc:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=rnE2VzpNys0:Ta-Me6JCcKc:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=rnE2VzpNys0:Ta-Me6JCcKc:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=rnE2VzpNys0:Ta-Me6JCcKc:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Dotnetexpertguide/~4/rnE2VzpNys0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.dotnetexpertguide.com/feeds/1711369626803168798/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.dotnetexpertguide.com/2011/09/display-mode-in-mvc-4aspnet-mvc-4.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/1711369626803168798?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/1711369626803168798?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Dotnetexpertguide/~3/rnE2VzpNys0/display-mode-in-mvc-4aspnet-mvc-4.html" title="Display Mode in ASP.NET MVC 4" /><author><name>Nandip Makwana</name><uri>https://profiles.google.com/100983452498554383356</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-pDb4IK6WZRs/AAAAAAAAAAI/AAAAAAAAAf4/0K7LrsiXehI/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-zBcDMrojbuQ/TnocZSshl0I/AAAAAAAAAWI/Ni3qIlTzowo/s72-c/Views.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.dotnetexpertguide.com/2011/09/display-mode-in-mvc-4aspnet-mvc-4.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkAMRHc5eSp7ImA9WhdVE04.&quot;"><id>tag:blogger.com,1999:blog-7819331473560289523.post-6427005555622324950</id><published>2011-09-18T12:56:00.000+05:30</published><updated>2011-09-18T12:56:25.921+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-18T12:56:25.921+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MVC" /><category scheme="http://www.blogger.com/atom/ns#" term="MVC 4" /><category scheme="http://www.blogger.com/atom/ns#" term="jQuery Mobile" /><category scheme="http://www.blogger.com/atom/ns#" term="jQuery" /><title>ASP.NET MVC 4 Mobile Project Template</title><content type="html">&lt;p&gt;This post is part of &lt;a href="http://www.dotnetexpertguide.com/2011/09/aspnet-mvc-4-article-series.html" target="_blank"&gt;ASP.NET MVC 4 Article Series&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;With &lt;a href="http://www.asp.net/mvc/mvc4" target="_blank"&gt;ASP.NET MVC 4&lt;/a&gt;, it’s even easier to setup and carry out a project which target mobile and tablet device. Yes MVC team introduce a new project template with MVC 4 which target mobile and tablet platform. This project template is build on the base of &lt;a href="http://jquerymobile.com/" target="_blank"&gt;jQuery Mobile&lt;/a&gt;. And hence it is also optimized for better experience for touch screen.&lt;/p&gt;
&lt;h4&gt;To get started with Mobile Project Template in MVC 4&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Create a new &lt;b&gt;ASP.NET MVC 4 Web Application&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Select &lt;b&gt;Mobile Application&lt;/b&gt; template when it ask to select project template&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-uURWFAiLpas/TnWZHFIf_vI/AAAAAAAAAVk/GIeolLLuxM8/s1600/2.1+Project+Template.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-uURWFAiLpas/TnWZHFIf_vI/AAAAAAAAAVk/GIeolLLuxM8/s1600/2.1+Project+Template.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;As far as the server side code (Controller, Model) is concern, it is same structured as Internet Application template. But responsibility of well rendering and well behavior for touch media is left on jQuery Mobile.&lt;/p&gt;
&lt;p&gt;Inspecting &lt;b&gt;Script folder&lt;/b&gt; of Internet Application Template and Mobile Project Template, you will find additional &lt;b&gt;jquery.mobile-1.0b2.js&lt;/b&gt; file which is core script of jQuery Mobile included in Mobile Project Template of MVC 4.&lt;br /&gt;&lt;/p&gt;
&lt;table width="100%"&gt;
&lt;tr&gt;
&lt;td&gt;&lt;b&gt;Internet Application Project&lt;/b&gt;&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-djIXpurx1GM/TnWZH8T4PiI/AAAAAAAAAVo/3d0r_LMd7FE/s1600/3+Internet+App+Project+Script.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://3.bp.blogspot.com/-djIXpurx1GM/TnWZH8T4PiI/AAAAAAAAAVo/3d0r_LMd7FE/s400/3+Internet+App+Project+Script.png" width="266" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;Mobile Project&lt;/b&gt;&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-u1oLB1MeWj4/TnWZJZQUn4I/AAAAAAAAAVs/nVkrq5_yoDQ/s1600/4+Mobile+Project+Script.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://4.bp.blogspot.com/-u1oLB1MeWj4/TnWZJZQUn4I/AAAAAAAAAVs/nVkrq5_yoDQ/s400/4+Mobile+Project+Script.png" width="266" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;Another major difference between Internet Application Template and Mobile Project Template is in its view. Inspecting &lt;b&gt;_Layout.cshtml&lt;/b&gt;, you will notice some additional script reference and script in Mobile Project which is used by mobile or template device. In addition to script, another major difference in MVC 4 Mobile Project Template View is use of &lt;b&gt;data-role&lt;/b&gt; and other attribute which is required for Mobile page structure and it used by mobile device and jQuery Mobile for proper rendering and behavior in touch screen and Smartphone. You can get more information regarding this &lt;a href="http://jquerymobile.com/demos/1.0a3/docs/pages/docs-pages.html" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;h4&gt;ASP.NET MVC 4 Mobile Project Template&lt;/h4&gt;
&lt;table width="100%"&gt;
&lt;tr&gt;
&lt;td&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-LFEhxkOjtG0/TnWZLPzG66I/AAAAAAAAAVw/dA-ei8qKQPA/s1600/5+Home.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://2.bp.blogspot.com/-LFEhxkOjtG0/TnWZLPzG66I/AAAAAAAAAVw/dA-ei8qKQPA/s320/5+Home.png" width="189" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-plkeVt4iZ5I/TnWZNBooF2I/AAAAAAAAAV0/HeMJpYFt2kw/s1600/6+About.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://3.bp.blogspot.com/-plkeVt4iZ5I/TnWZNBooF2I/AAAAAAAAAV0/HeMJpYFt2kw/s320/6+About.png" width="189" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-QzrtWfHD0K0/TnWZPQJm2ZI/AAAAAAAAAV4/gI0USF_cgxE/s1600/7+Contact.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://3.bp.blogspot.com/-QzrtWfHD0K0/TnWZPQJm2ZI/AAAAAAAAAV4/gI0USF_cgxE/s320/7+Contact.png" width="189" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;table width="100%"&gt;
&lt;tr&gt;
&lt;td&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-fl7yqSqTasY/TnWZRlmIiHI/AAAAAAAAAV8/Ju-GmHwCBV0/s1600/8+Log+on.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://1.bp.blogspot.com/-fl7yqSqTasY/TnWZRlmIiHI/AAAAAAAAAV8/Ju-GmHwCBV0/s320/8+Log+on.png" width="189" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-941EhPmdjL4/TnWZTi05bYI/AAAAAAAAAWA/42KnTYnYJso/s1600/9+Register.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://3.bp.blogspot.com/-941EhPmdjL4/TnWZTi05bYI/AAAAAAAAAWA/42KnTYnYJso/s320/9+Register.png" width="189" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;Hope It would be helpful.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7819331473560289523-6427005555622324950?l=www.dotnetexpertguide.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/8UaOErhfu9eihc3yFD0kKiPcV8I/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8UaOErhfu9eihc3yFD0kKiPcV8I/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/8UaOErhfu9eihc3yFD0kKiPcV8I/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8UaOErhfu9eihc3yFD0kKiPcV8I/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=QHx0DZW921A:BiZk0_KBgwQ:iuKBeV4sXr0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=QHx0DZW921A:BiZk0_KBgwQ:iuKBeV4sXr0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=QHx0DZW921A:BiZk0_KBgwQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=QHx0DZW921A:BiZk0_KBgwQ:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=QHx0DZW921A:BiZk0_KBgwQ:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=QHx0DZW921A:BiZk0_KBgwQ:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=QHx0DZW921A:BiZk0_KBgwQ:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=QHx0DZW921A:BiZk0_KBgwQ:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=QHx0DZW921A:BiZk0_KBgwQ:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Dotnetexpertguide/~4/QHx0DZW921A" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.dotnetexpertguide.com/feeds/6427005555622324950/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.dotnetexpertguide.com/2011/09/aspnet-mvc-4-mobile-project-template.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/6427005555622324950?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/6427005555622324950?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Dotnetexpertguide/~3/QHx0DZW921A/aspnet-mvc-4-mobile-project-template.html" title="ASP.NET MVC 4 Mobile Project Template" /><author><name>Nandip Makwana</name><uri>https://profiles.google.com/100983452498554383356</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-pDb4IK6WZRs/AAAAAAAAAAI/AAAAAAAAAf4/0K7LrsiXehI/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-uURWFAiLpas/TnWZHFIf_vI/AAAAAAAAAVk/GIeolLLuxM8/s72-c/2.1+Project+Template.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.dotnetexpertguide.com/2011/09/aspnet-mvc-4-mobile-project-template.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ck4AR3cycCp7ImA9WhdVE04.&quot;"><id>tag:blogger.com,1999:blog-7819331473560289523.post-4509316130096629265</id><published>2011-09-16T08:28:00.000+05:30</published><updated>2011-09-18T12:59:06.998+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-18T12:59:06.998+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MVC" /><category scheme="http://www.blogger.com/atom/ns#" term="MVC 4" /><title>First look at ASP.NET MVC 4 Templates</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
This post is part of &lt;a href="http://www.dotnetexpertguide.com/2011/09/aspnet-mvc-4-article-series.html" target="blank"&gt;ASP.NET MVC 4 Article Series&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
With release of &lt;a href="http://www.asp.net/mvc/mvc4" target="blank"&gt;ASP.NET MVC 4&lt;/a&gt; Developer Preview, ASP.NET MVC team introduces a new default project template for MVC 4. New template has following improvements.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Cosmetic Improvements&lt;/b&gt;&lt;br /&gt;
New MVC 4 project template has cosmetic improvements prior to MVC 3 project template. And it will help community to create good looking modern websites with the default template itself without investing more in template designing.
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-kVx506cgAPA/TnK4uUQGdrI/AAAAAAAAAUw/LQb-97uRvY0/s1600/home.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="433" src="http://4.bp.blogspot.com/-kVx506cgAPA/TnK4uUQGdrI/AAAAAAAAAUw/LQb-97uRvY0/s640/home.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/--wE6z-skTl4/TnK4ulFTMfI/AAAAAAAAAU4/PDFKz-WYkBM/s1600/About.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="434" src="http://2.bp.blogspot.com/--wE6z-skTl4/TnK4ulFTMfI/AAAAAAAAAU4/PDFKz-WYkBM/s640/About.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-idbV-NmyQig/TnK4upRIHkI/AAAAAAAAAVA/SW3r02Aku80/s1600/Contact.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="434" src="http://3.bp.blogspot.com/-idbV-NmyQig/TnK4upRIHkI/AAAAAAAAAVA/SW3r02Aku80/s640/Contact.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;b&gt;Adaptive Rendering&lt;/b&gt;&lt;br /&gt;
Along with cosmetic improvements, new MVC 4 template used technique called Adaptive Rendering which will help in proper rendering in desktop browser as well mobile browser also without making any changes. To see Adaptive Rendering in action, resize browser window to be smaller and accordingly MVC 4 template layout will be changed to fit with screen size.
&lt;br /&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="http://2.bp.blogspot.com/-ufWkRpwuxwg/TnK5euhvrwI/AAAAAAAAAVI/1hyiCbJl_pk/s1600/home-small.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://2.bp.blogspot.com/-ufWkRpwuxwg/TnK5euhvrwI/AAAAAAAAAVI/1hyiCbJl_pk/s320/home-small.png" width="180" /&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="http://4.bp.blogspot.com/-yoRdu36F_3U/TnK5e8xIoPI/AAAAAAAAAVQ/zze_DZ5GKxw/s1600/about-small.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://4.bp.blogspot.com/-yoRdu36F_3U/TnK5e8xIoPI/AAAAAAAAAVQ/zze_DZ5GKxw/s320/about-small.png" width="180" /&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="http://4.bp.blogspot.com/-uCTz77Xe9wE/TnK5e8f4uEI/AAAAAAAAAVY/YAiOD6HAV98/s1600/contact-small.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://4.bp.blogspot.com/-uCTz77Xe9wE/TnK5e8f4uEI/AAAAAAAAAVY/YAiOD6HAV98/s320/contact-small.png" width="180" /&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;b&gt;Rich UI&lt;/b&gt;&lt;br /&gt;
Another major improvement with MVC 4 default project template is use of JavaScript and jQuery plugins to provide rich UI. Click on Register and Login link to see rich UI in action.&lt;br /&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="http://1.bp.blogspot.com/-5vddx0DA__E/TnK6FoblXcI/AAAAAAAAAVg/Jh1OOEQvGrs/s1600/register.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://1.bp.blogspot.com/-5vddx0DA__E/TnK6FoblXcI/AAAAAAAAAVg/Jh1OOEQvGrs/s320/register.png" width="295" /&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="http://3.bp.blogspot.com/-zIRwOpO6lsg/TnK6D_L57JI/AAAAAAAAAVc/-8IvaOQHCyQ/s1600/login.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="302" src="http://3.bp.blogspot.com/-zIRwOpO6lsg/TnK6D_L57JI/AAAAAAAAAVc/-8IvaOQHCyQ/s320/login.png" width="320" /&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7819331473560289523-4509316130096629265?l=www.dotnetexpertguide.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/x8aB9kOHLotIz0MosFxODJG9tLs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/x8aB9kOHLotIz0MosFxODJG9tLs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/x8aB9kOHLotIz0MosFxODJG9tLs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/x8aB9kOHLotIz0MosFxODJG9tLs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=o6k4owMlvpQ:Brostsnr5xw:iuKBeV4sXr0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=o6k4owMlvpQ:Brostsnr5xw:iuKBeV4sXr0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=o6k4owMlvpQ:Brostsnr5xw:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=o6k4owMlvpQ:Brostsnr5xw:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=o6k4owMlvpQ:Brostsnr5xw:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=o6k4owMlvpQ:Brostsnr5xw:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=o6k4owMlvpQ:Brostsnr5xw:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=o6k4owMlvpQ:Brostsnr5xw:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=o6k4owMlvpQ:Brostsnr5xw:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Dotnetexpertguide/~4/o6k4owMlvpQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.dotnetexpertguide.com/feeds/4509316130096629265/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.dotnetexpertguide.com/2011/09/first-look-at-aspnet-mvc-4-templates.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/4509316130096629265?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/4509316130096629265?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Dotnetexpertguide/~3/o6k4owMlvpQ/first-look-at-aspnet-mvc-4-templates.html" title="First look at ASP.NET MVC 4 Templates" /><author><name>Nandip Makwana</name><uri>https://profiles.google.com/100983452498554383356</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-pDb4IK6WZRs/AAAAAAAAAAI/AAAAAAAAAf4/0K7LrsiXehI/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-kVx506cgAPA/TnK4uUQGdrI/AAAAAAAAAUw/LQb-97uRvY0/s72-c/home.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.dotnetexpertguide.com/2011/09/first-look-at-aspnet-mvc-4-templates.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0EDSHo_eCp7ImA9WhdVEU0.&quot;"><id>tag:blogger.com,1999:blog-7819331473560289523.post-1613376921620317627</id><published>2011-09-15T23:31:00.000+05:30</published><updated>2011-09-15T23:31:19.440+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-15T23:31:19.440+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MVC" /><category scheme="http://www.blogger.com/atom/ns#" term="MVC 4" /><title>Getting Started With ASP.NET MVC 4</title><content type="html">This post is part of &lt;a href="http://www.dotnetexpertguide.com/2011/09/aspnet-mvc-4-article-series.html"  target="_blank"&gt;ASP.NET MVC 4 Article Series&lt;/a&gt;.
&lt;br/&gt;&lt;br/&gt;
In this first post of ASP.NET &lt;a href="http://asp.net/mvc/mvc4" target="_blank"&gt;MVC 4&lt;/a&gt; article series, we will see how and from where we can download and install MVC 4. Following are the different useful links for downloading ASP.NET MVC 4.
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;ASP.NET MVC 4 NuGet Packages&lt;/b&gt;&lt;br /&gt;
One good news is that MVC 4 is also available via &lt;a href="http://www.nuget.org/" target="_blank"&gt;NuGet&lt;/a&gt;. To install MVC 4 via NuGet, type following in the Package Manager Console.
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-resO0Vb2Aww/TnI16Y-XfCI/AAAAAAAAAUg/qVv_V1CD7wU/s1600/NuGet.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-resO0Vb2Aww/TnI16Y-XfCI/AAAAAAAAAUg/qVv_V1CD7wU/s1600/NuGet.png" /&gt;&lt;/a&gt;&lt;/div&gt;
For more detail regarding NuGet package please visit &lt;a href="http://www.nuget.org/List/Packages/AspNetMvc" target="_blank"&gt;http://www.nuget.org/List/Packages/AspNetMvc&lt;/a&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;ASP.NET MVC 4 for Visual Studio 2010&lt;/b&gt;&lt;br/&gt;
If you are using Visual Studio 2010 then you can use MVC 4 with Visual Studio 2010. To install MVC 4 via Web Platform Installer for Visual Studio 2010 please visit following link.&lt;br/&gt;
&lt;a target="_blank" href="http://www.microsoft.com/web/gallery/install.aspx?appid=MVC4VS2010&amp;prerelease=true"&gt;http://www.microsoft.com/web/gallery/install.aspx?appid=MVC4VS2010&amp;prerelease=true&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;
&lt;b&gt;ASP.NET MVC 4 for Visual Studio 11 Developer Preview&lt;/b&gt;&lt;br/&gt;
If you are using Visual Studio 11 Developer Preview then you can install MVC 4 in Visual Studio 11 Developer Preview via following link.&lt;br/&gt;
&lt;a target="_blank" href="http://www.microsoft.com/web/gallery/install.aspx?appid=MVC4VS11&amp;prerelease=true"&gt;http://www.microsoft.com/web/gallery/install.aspx?appid=MVC4VS11&amp;prerelease=true&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;
&lt;b&gt;ASP.NET MVC 4 Direct Download Link&lt;/b&gt;&lt;br/&gt;
For Visual Studio 2010, first you need to install Visual Studio 2010 SP1 KB983509 via &lt;a target="_blank" href="http://download.microsoft.com/download/2/3/0/230C4F4A-2D3C-4D3B-B991-2A9133904E35/VS10sp1-KB983509.exe"&gt;http://download.microsoft.com/download/2/3/0/230C4F4A-2D3C-4D3B-B991-2A9133904E35/VS10sp1-KB983509.exe&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;
MVC 4 Direct link for Visual Studio 2010 &lt;a target="_blank" href="http://download.microsoft.com/download/E/D/7/ED7CB028-2CBD-4E26-87D5-C9164A0B4849/AspNetMVC4VisualStudio2010Setup.exe"&gt;http://download.microsoft.com/download/E/D/7/ED7CB028-2CBD-4E26-87D5-C9164A0B4849/AspNetMVC4VisualStudio2010Setup.exe&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;
MVC 4 Direct link for Visual Studio 11 Developer Preview &lt;a target="_blank" href="http://download.microsoft.com/download/E/D/7/ED7CB028-2CBD-4E26-87D5-C9164A0B4849/AspNetMVC4VisualStudio11Setup.exe"&gt;http://download.microsoft.com/download/E/D/7/ED7CB028-2CBD-4E26-87D5-C9164A0B4849/AspNetMVC4VisualStudio11Setup.exe&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;
&lt;b&gt;Useful links&lt;/b&gt;&lt;br/&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://asp.net/mvc/mvc4" target="_blank"&gt;http://asp.net/mvc/mvc4&lt;/a&gt; for latest update regarding MVC 4&lt;/li&gt;
&lt;li&gt;&lt;a href="http://forums.asp.net/1146.aspx" target="_blank"&gt;http://forums.asp.net/1146.aspx&lt;/a&gt; ASP.NET MVC forum&lt;/li&gt;
&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7819331473560289523-1613376921620317627?l=www.dotnetexpertguide.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/w1RmD8ox6hVdavhmZWJwoni2kMs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/w1RmD8ox6hVdavhmZWJwoni2kMs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/w1RmD8ox6hVdavhmZWJwoni2kMs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/w1RmD8ox6hVdavhmZWJwoni2kMs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=2plwudi3QRs:Q50a_rImJb8:iuKBeV4sXr0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=2plwudi3QRs:Q50a_rImJb8:iuKBeV4sXr0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=2plwudi3QRs:Q50a_rImJb8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=2plwudi3QRs:Q50a_rImJb8:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=2plwudi3QRs:Q50a_rImJb8:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=2plwudi3QRs:Q50a_rImJb8:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=2plwudi3QRs:Q50a_rImJb8:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=2plwudi3QRs:Q50a_rImJb8:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=2plwudi3QRs:Q50a_rImJb8:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Dotnetexpertguide/~4/2plwudi3QRs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.dotnetexpertguide.com/feeds/1613376921620317627/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.dotnetexpertguide.com/2011/09/getting-started-with-aspnet-mvc-4.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/1613376921620317627?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/1613376921620317627?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Dotnetexpertguide/~3/2plwudi3QRs/getting-started-with-aspnet-mvc-4.html" title="Getting Started With ASP.NET MVC 4" /><author><name>Nandip Makwana</name><uri>https://profiles.google.com/100983452498554383356</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-pDb4IK6WZRs/AAAAAAAAAAI/AAAAAAAAAf4/0K7LrsiXehI/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-resO0Vb2Aww/TnI16Y-XfCI/AAAAAAAAAUg/qVv_V1CD7wU/s72-c/NuGet.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.dotnetexpertguide.com/2011/09/getting-started-with-aspnet-mvc-4.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0EBQnY7eSp7ImA9WhRXF0U.&quot;"><id>tag:blogger.com,1999:blog-7819331473560289523.post-8304795481189706509</id><published>2011-09-15T23:28:00.000+05:30</published><updated>2011-12-25T10:37:33.801+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-25T10:37:33.801+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MVC" /><category scheme="http://www.blogger.com/atom/ns#" term="MVC 4" /><title>ASP.NET MVC 4 Article Series</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-yHRCCyskLlI/TnJAJRQ1fCI/AAAAAAAAAUo/GXRwjwgCieE/s1600/ASP.NET+h.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="95" src="http://4.bp.blogspot.com/-yHRCCyskLlI/TnJAJRQ1fCI/AAAAAAAAAUo/GXRwjwgCieE/s200/ASP.NET+h.png" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;
Well after a long buzz of &lt;a href="http://www.asp.net/vnext" target="_blank"&gt;vNext (ASP.NET 4.5)&lt;/a&gt; and &lt;a href="http://www.asp.net/mvc/mvc4" target="_blank"&gt;MVC 4&lt;/a&gt;. Yesterday Microsoft released a developer preview of ASP.NET 4.5 and MVC 4. For a next couple of day I am going to post about cool new features of MVC 4. And accordingly I will update this page with updated MVC 4 post links.
&lt;br /&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.dotnetexpertguide.com/2011/09/getting-started-with-aspnet-mvc-4.html" target="_blank"&gt;Getting Started With ASP.NET MVC 4&lt;/a&gt; (15-Sep-2011)&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.dotnetexpertguide.com/2011/09/first-look-at-aspnet-mvc-4-templates.html" target="_blank"&gt;First look at ASP.NET MVC 4 Templates&lt;/a&gt; (16-Sep-2011)&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.dotnetexpertguide.com/2011/09/aspnet-mvc-4-mobile-project-template.html" target="_blank"&gt;ASP.NET MVC 4 Mobile Project Template&lt;/a&gt; (18-Sep-2011)&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.dotnetexpertguide.com/2011/09/display-mode-in-mvc-4aspnet-mvc-4.html" target="_blank"&gt;Display Mode in ASP.NET MVC 4 &lt;/a&gt; (21-Sep-2011)&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.dotnetexpertguide.com/2011/09/under-hood-of-display-mode-mvc-4.html" target="_blank"&gt;Under the Hood of Display Mode in MVC 4 &lt;/a&gt; (27-Sep-2011)&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.asp.net/mvc/tutorials/aspnet-mvc-4-mobile-features" target="_blank"&gt;ASP.NET MVC 4 Mobile Features &lt;/a&gt; (By Rick Anderson)&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.dotnetexpertguide.com/2011/12/upgrade-aspnet-mvc-3-project-to-mvc-4.html" target="_blank"&gt;Upgrading an ASP.NET MVC 3 Project to ASP.NET MVC 4&lt;/a&gt; (13-Dec-2011)&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.dotnetexpertguide.com/2011/12/bundling-and-minification-aspnet-mvc4.html" target="_blank"&gt;Bundling and Minification in ASP.NET MVC 4&lt;/a&gt; (23-Dec-2011)&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.dotnetexpertguide.com/2011/12/custom-transformtype-bundling.html" target="_blank"&gt;Creating Custom Transform Type for Bundling and Minification in .NET 4.5 &amp; MVC 4&lt;/a&gt; (24-Dec-2011)&lt;/li&gt;
&lt;/ul&gt;
Hope it would be helpful.
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7819331473560289523-8304795481189706509?l=www.dotnetexpertguide.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/TK_TiZLiIyzggwbq0BpFUCedGQE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/TK_TiZLiIyzggwbq0BpFUCedGQE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/TK_TiZLiIyzggwbq0BpFUCedGQE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/TK_TiZLiIyzggwbq0BpFUCedGQE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=FZKXinDhPzM:TTPKUN1shPQ:iuKBeV4sXr0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=FZKXinDhPzM:TTPKUN1shPQ:iuKBeV4sXr0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=FZKXinDhPzM:TTPKUN1shPQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=FZKXinDhPzM:TTPKUN1shPQ:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=FZKXinDhPzM:TTPKUN1shPQ:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=FZKXinDhPzM:TTPKUN1shPQ:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=FZKXinDhPzM:TTPKUN1shPQ:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=FZKXinDhPzM:TTPKUN1shPQ:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=FZKXinDhPzM:TTPKUN1shPQ:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Dotnetexpertguide/~4/FZKXinDhPzM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.dotnetexpertguide.com/feeds/8304795481189706509/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.dotnetexpertguide.com/2011/09/aspnet-mvc-4-article-series.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/8304795481189706509?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/8304795481189706509?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Dotnetexpertguide/~3/FZKXinDhPzM/aspnet-mvc-4-article-series.html" title="ASP.NET MVC 4 Article Series" /><author><name>Nandip Makwana</name><uri>https://profiles.google.com/100983452498554383356</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-pDb4IK6WZRs/AAAAAAAAAAI/AAAAAAAAAf4/0K7LrsiXehI/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-yHRCCyskLlI/TnJAJRQ1fCI/AAAAAAAAAUo/GXRwjwgCieE/s72-c/ASP.NET+h.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.dotnetexpertguide.com/2011/09/aspnet-mvc-4-article-series.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DE4DQH4yfCp7ImA9WhRbFUU.&quot;"><id>tag:blogger.com,1999:blog-7819331473560289523.post-2497972572959747020</id><published>2011-09-02T07:44:00.001+05:30</published><updated>2012-02-07T09:26:11.094+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-02-07T09:26:11.094+05:30</app:edited><title>Article featured on official ASP.NET website home page!!</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;b&gt;Last Updated On : 7-Feb-2012&lt;/b&gt;&lt;br /&gt;
This page keep track of article featured on &lt;a href="http://www.asp.net/" target="_blank"&gt;www.asp.net&lt;/a&gt;. My first article was featured in August 2011. Starting from August 2011, There are total 9 article featured till February 2012. Thanks to all reader of &lt;a href="http://www.dotnetexpertguide.com/" target="_blank"&gt;dotnetExprtGuide.com&lt;/a&gt; for making this success.
&lt;br /&gt;
&lt;br /&gt;
Very soon we hope to start article series on new release of Visual Studio and ASP.NET. So stay connected. You can also connect us through following social media.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://feeds.feedburner.com/Dotnetexpertguide" target="_blank" title="Subscribe via RSS"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-pU9va9j6CRM/TXVqXVqF78I/AAAAAAAAETk/Om3018umd6c/rss_32.png" /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="http://www.facebook.com/dotnetExpertGuide" target="_blank" title="Like us on Facebook"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-1SHrcXai4U8/TXVqXLy5_iI/AAAAAAAAETc/oxSLPBnPQvc/facebook_32.png" /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="http://twitter.com/NandipMakwana" target="_blank" title="Follow us on Twitter"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-ASykdggJLF0/TXVqfONMDsI/AAAAAAAAET8/pqEyxcfG1Yc/twitter_32.png" /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="http://feedburner.google.com/fb/a/mailverify?uri=Dotnetexpertguide" target="_blank" title="Subscribe via Email"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-PZs2wKjVkYo/TXVqXNIlQkI/AAAAAAAAETU/H20hbb9BsDw/email_32.png" /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;10-Aug-2011: Article of the day &lt;a href="http://www.dotnetexpertguide.com/2011/05/validate-uploaded-image-content-in.html"&gt;Validate uploaded image content in ASP.NET&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;31-Aug-2011: www.asp.net homepage &lt;a href="http://www.dotnetexpertguide.com/2011/05/validate-uploaded-image-content-in.html"&gt;Validate uploaded image content in ASP.NET&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;25-Sep-2011: www.asp.net homepage &lt;a href="http://www.dotnetexpertguide.com/2011/09/aspnet-mvc-4-article-series.html"&gt;ASP.NET MVC 4 Article Series&lt;/a&gt; Also available on &lt;a href="http://msdn.microsoft.com/en-us/library/gg416514%28v=VS.98%29.aspx" target="_blank"&gt;MSDN&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;02-Nov-2011: Article of the day &lt;a href="http://www.dotnetexpertguide.com/2011/09/under-hood-of-display-mode-mvc-4.html"&gt;Under the Hood of Display Mode in MVC 4&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;07-Nov-2011: Article of the day &lt;a href="http://www.dotnetexpertguide.com/2011/07/aspnet-40-visualize-responseredirectper.html"&gt;ASP.NET 4.0 : Visualize Response.RedirectPermanent&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;25-Nov-2011: Article of the day &lt;a href="http://www.dotnetexpertguide.com/2011/10/c-sharp-syntax-checker-aspnet-roslyn.html"&gt;Build Online C# Syntax Checker with Roslyn&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;23-Dec-2011: www.asp.net homepage &lt;a href="http://www.dotnetexpertguide.com/2011/12/custom-transformtype-bundling.html"&gt;Creating Custom Transform Type for Bundling and Minification in .NET 4.5&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2-Jan-2012: Article of the day &lt;a href="http://www.dotnetexpertguide.com/2011/12/bundling-and-minification-aspnet-mvc4.html"&gt;Bundling and Minification in ASP.NET MVC 4&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;6-Feb-2012: Article of the day &lt;a href="http://www.dotnetexpertguide.com/2012/01/dividing-mvc-components-in-separate.html"&gt;Dividing ASP.NET MVC Components in Separate Projects&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;table&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td align="center" colspan="2" valign="top"&gt;&lt;b&gt;6-Feb-2012: Article of the day&lt;/b&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-9geut99KGlQ/TzCFNQAIDxI/AAAAAAAAAjU/K6LJFyy-lsI/s1600/6-Feb-2012%2Bpartial%2B1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="176" src="http://4.bp.blogspot.com/-9geut99KGlQ/TzCFNQAIDxI/AAAAAAAAAjU/K6LJFyy-lsI/s320/6-Feb-2012%2Bpartial%2B1.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;&lt;b&gt;2-Jan-2012: Article of the day&lt;/b&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-ql-fLk2g_ok/TwJj6hjyFTI/AAAAAAAAAhc/55CQFYiTGdc/s1600/2-Jan-2012%2BPartial%2B1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="172" src="http://1.bp.blogspot.com/-ql-fLk2g_ok/TwJj6hjyFTI/AAAAAAAAAhc/55CQFYiTGdc/s320/2-Jan-2012%2BPartial%2B1.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td valign="top"&gt;&lt;b&gt;23-Dec-2011: www.asp.net homepage&lt;/b&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-roxPjRftjmE/Tvkm0tnsBjI/AAAAAAAAAhQ/GH29WkTlMDM/s1600/23-Dec-11%2BPartial%2B1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="192" src="http://2.bp.blogspot.com/-roxPjRftjmE/Tvkm0tnsBjI/AAAAAAAAAhQ/GH29WkTlMDM/s320/23-Dec-11%2BPartial%2B1.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;&lt;b&gt;25-Nov-2011: Article of the day&lt;/b&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-2tCL6HbMpB8/TtA-8VVR3RI/AAAAAAAAAcw/zr5jwZSTr3Y/s1600/25-Nov-11.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="280" src="http://1.bp.blogspot.com/-2tCL6HbMpB8/TtA-8VVR3RI/AAAAAAAAAcw/zr5jwZSTr3Y/s320/25-Nov-11.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td valign="top"&gt;&lt;b&gt;07-Nov-2011: Article of the day&lt;/b&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-1lz2X3jyoV8/TriFew9vh_I/AAAAAAAAAcM/itFLS9inKRA/s1600/7-Nov-11.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="233" src="http://1.bp.blogspot.com/-1lz2X3jyoV8/TriFew9vh_I/AAAAAAAAAcM/itFLS9inKRA/s320/7-Nov-11.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;&lt;b&gt;02-Nov-2011: Article of the day&lt;/b&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-zbROMg9P0NY/Trc6zhxSBCI/AAAAAAAAAbc/LQ5nJ_uZpZ4/s1600/2-Nov-11.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="244" src="http://2.bp.blogspot.com/-zbROMg9P0NY/Trc6zhxSBCI/AAAAAAAAAbc/LQ5nJ_uZpZ4/s320/2-Nov-11.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td valign="top"&gt;&lt;b&gt;25-Sep-2011: www.asp.net homepage&lt;/b&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-qGkl_S129Tc/Trc60PW4RXI/AAAAAAAAAb4/xAlNZQOYi0E/s1600/25-Sep-11.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="290" src="http://2.bp.blogspot.com/-qGkl_S129Tc/Trc60PW4RXI/AAAAAAAAAb4/xAlNZQOYi0E/s320/25-Sep-11.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;&lt;b&gt;31-Aug-2011: www.asp.net homepage&lt;/b&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-E5chUDB2FMY/Trc60pWlmWI/AAAAAAAAAcA/PsDo1ygGpYc/s1600/31-Aug-11.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-E5chUDB2FMY/Trc60pWlmWI/AAAAAAAAAcA/PsDo1ygGpYc/s320/31-Aug-11.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td valign="top"&gt;&lt;b&gt;10-Aug-2011: Article of the day&lt;/b&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-qzDRtojPR1s/Trc6z2AOZgI/AAAAAAAAAbo/XxdRmTZ7EVA/s1600/10-Aug-11.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="278" src="http://3.bp.blogspot.com/-qzDRtojPR1s/Trc6z2AOZgI/AAAAAAAAAbo/XxdRmTZ7EVA/s320/10-Aug-11.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
You can also connect us through following social media.&lt;br /&gt;
&lt;a href="http://feeds.feedburner.com/Dotnetexpertguide" target="_blank" title="Subscribe via RSS"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-pU9va9j6CRM/TXVqXVqF78I/AAAAAAAAETk/Om3018umd6c/rss_32.png" /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="http://www.facebook.com/dotnetExpertGuide" target="_blank" title="Like us on Facebook"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-1SHrcXai4U8/TXVqXLy5_iI/AAAAAAAAETc/oxSLPBnPQvc/facebook_32.png" /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="http://twitter.com/NandipMakwana" target="_blank" title="Follow us on Twitter"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-ASykdggJLF0/TXVqfONMDsI/AAAAAAAAET8/pqEyxcfG1Yc/twitter_32.png" /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="http://feedburner.google.com/fb/a/mailverify?uri=Dotnetexpertguide" target="_blank" title="Subscribe via Email"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-PZs2wKjVkYo/TXVqXNIlQkI/AAAAAAAAETU/H20hbb9BsDw/email_32.png" /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;
&lt;br /&gt;
&lt;hr /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7819331473560289523-2497972572959747020?l=www.dotnetexpertguide.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/d5SiqlTgs0RKr_Q4jKr9FmGRZJM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/d5SiqlTgs0RKr_Q4jKr9FmGRZJM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/d5SiqlTgs0RKr_Q4jKr9FmGRZJM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/d5SiqlTgs0RKr_Q4jKr9FmGRZJM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=GN2JappoD7E:6sTFp6ZuKRo:iuKBeV4sXr0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=GN2JappoD7E:6sTFp6ZuKRo:iuKBeV4sXr0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=GN2JappoD7E:6sTFp6ZuKRo:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=GN2JappoD7E:6sTFp6ZuKRo:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=GN2JappoD7E:6sTFp6ZuKRo:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=GN2JappoD7E:6sTFp6ZuKRo:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=GN2JappoD7E:6sTFp6ZuKRo:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=GN2JappoD7E:6sTFp6ZuKRo:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=GN2JappoD7E:6sTFp6ZuKRo:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Dotnetexpertguide/~4/GN2JappoD7E" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.dotnetexpertguide.com/feeds/2497972572959747020/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.dotnetexpertguide.com/2011/09/article-featured-on-official-aspnet.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/2497972572959747020?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/2497972572959747020?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Dotnetexpertguide/~3/GN2JappoD7E/article-featured-on-official-aspnet.html" title="Article featured on official ASP.NET website home page!!" /><author><name>Nandip Makwana</name><uri>https://profiles.google.com/100983452498554383356</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-pDb4IK6WZRs/AAAAAAAAAAI/AAAAAAAAAf4/0K7LrsiXehI/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-pU9va9j6CRM/TXVqXVqF78I/AAAAAAAAETk/Om3018umd6c/s72-c/rss_32.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.dotnetexpertguide.com/2011/09/article-featured-on-official-aspnet.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEcCRHg5eSp7ImA9WhdaGUk.&quot;"><id>tag:blogger.com,1999:blog-7819331473560289523.post-6852007090076128614</id><published>2011-08-19T22:08:00.000+05:30</published><updated>2011-10-30T09:11:05.621+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-30T09:11:05.621+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="URL Rewrite" /><category scheme="http://www.blogger.com/atom/ns#" term="IIS" /><category scheme="http://www.blogger.com/atom/ns#" term="SEO" /><category scheme="http://www.blogger.com/atom/ns#" term="IIS 7" /><title>IIS 7 : Redirect domain.com to www.domain.com</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;a href="http://www.iis.net/download/URLRewrite" target="_blank"&gt;IIS URL Rewrite extensions&lt;/a&gt; enables web administrator to enforce powerful rules to transform complex URLs into simple and consistent Web addresses. As well it also helps to produce user and search engine friendly URLs.
&lt;br /&gt;
&lt;br /&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
In this post, we will examine how we can use IIS URL Rewrite extensions to redirect &lt;b&gt;domain.com&lt;/b&gt; to &lt;b&gt;www.domain.com&lt;/b&gt;. For more information on how to &lt;a href="http://www.dotnetexpertguide.com/2011/08/connect-to-remote-site-through-remote.html" target="_blank"&gt;connect to remote website through IIS&lt;/a&gt; read my previous &lt;a href="http://www.dotnetexpertguide.com/2011/08/connect-to-remote-site-through-remote.html" target="_blank"&gt;post&lt;/a&gt;. As we all know that by default we can access website with or without WWW. For e.g. browsing &lt;b&gt;nandipmakwana.com&lt;/b&gt; and &lt;b&gt;www.nandipmakwana.com&lt;/b&gt; will open same website. &lt;b&gt;&lt;span style="color: #073763;"&gt;This means there are two different web addresses are available for one website and hence website’s SEO ranking will be distributed between these two addresses.&lt;/span&gt;&lt;/b&gt; To overcome these SEO ranking distribution, we can force all web traffic to redirect either domain.com or www.domain.com. Google web masters tool also allow web master to set &lt;a href="http://www.google.com/support/webmasters/bin/answer.py?answer=44231" target="_blank"&gt;preferred domain for indexing website URLs&lt;/a&gt;. 
&lt;/div&gt;
&lt;br /&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
So conclusion is that redirecting all web traffic to only one primary domain or canonical domain can improve SEO ranking. Following is the step to achieve same with IIS.
&lt;/div&gt;
&lt;br /&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Connect to website through IIS manager and click on URL Rewrite icon.
&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-mYSiPBNkCs0/Tk6Ms7qlnMI/AAAAAAAAATc/cYowRlmGgXg/s1600/1+iis+URL+rewrite.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-mYSiPBNkCs0/Tk6Ms7qlnMI/AAAAAAAAATc/cYowRlmGgXg/s1600/1+iis+URL+rewrite.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
In Actions pane click on Add Rules.
&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-jpbG9B9jEHY/Tk6Mt5w9rRI/AAAAAAAAATg/3B4jIwo9QpY/s1600/2+add+URL+rewrite+rule.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="212" src="http://3.bp.blogspot.com/-jpbG9B9jEHY/Tk6Mt5w9rRI/AAAAAAAAATg/3B4jIwo9QpY/s640/2+add+URL+rewrite+rule.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
In Add Rules dialog box click you can find several predefined rule template. Click on canonical domain name template under search engine optimization section.
&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-Bi80RUbNdo8/Tk6Mvs5iU-I/AAAAAAAAATk/79L6sxRFnck/s1600/3+select+rule+template.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="425" src="http://3.bp.blogspot.com/-Bi80RUbNdo8/Tk6Mvs5iU-I/AAAAAAAAATk/79L6sxRFnck/s640/3+select+rule+template.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
It will open dialog box to select primary domain for website. Choose appropriate options.
&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-pY_Cg3cUl78/Tk6MwtoWhVI/AAAAAAAAATo/7R0ntDe3K6E/s1600/4+select+primary+domain.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-pY_Cg3cUl78/Tk6MwtoWhVI/AAAAAAAAATo/7R0ntDe3K6E/s1600/4+select+primary+domain.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Press ok. You have done it. Now all your web traffic will be redirected to primary domain you have selected. And you can see added rewrite rule in list pane. But just using predefined rule template is not enough for web administrator. We should also dig into rule settings done by this rule template. For examine settings of created rule select rule in list pane and double click on it or click on Edit Rules link in Action Pane.
&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-T4bhQbFMgu8/Tk6My4Ng1FI/AAAAAAAAATs/XLci6qNMdmU/s1600/5+edit+inbound+rule.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="286" src="http://1.bp.blogspot.com/-T4bhQbFMgu8/Tk6My4Ng1FI/AAAAAAAAATs/XLci6qNMdmU/s640/5+edit+inbound+rule.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
It will open edit inbound rule window. Scroll down to bottom of window. There you will find Action sections. In action sections, there is one drop down named Action Type. Default value of Action Type is redirect.  Expand Action Type drop down to see different actions available for this rule.
&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-aVnWSEtS5SE/Tk6MzlgVY0I/AAAAAAAAATw/xiDPMjkQUcA/s1600/6+action+type.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="294" src="http://2.bp.blogspot.com/-aVnWSEtS5SE/Tk6MzlgVY0I/AAAAAAAAATw/xiDPMjkQUcA/s640/6+action+type.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
And below action type drop down there is another drop down Redirect Type. Default value of this is Permanent (301). Expand drop down to see list of available other redirect type.
&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-wCpXaQ3CGg4/Tk6M1G7PzvI/AAAAAAAAAT0/8yaZAvgbaxE/s1600/7+redirect+type.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="317" src="http://4.bp.blogspot.com/-wCpXaQ3CGg4/Tk6M1G7PzvI/AAAAAAAAAT0/8yaZAvgbaxE/s640/7+redirect+type.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Setting redirection type Permanent (301) will cause to send &lt;a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html" target="_blank"&gt;HTTP 301&lt;/a&gt; status code and then after it will redirect to primary domain. So search engine can index appropriate URLs.
&lt;/div&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7819331473560289523-6852007090076128614?l=www.dotnetexpertguide.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Spwu-b85FsENLVENqxbgHFtnvy4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Spwu-b85FsENLVENqxbgHFtnvy4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Spwu-b85FsENLVENqxbgHFtnvy4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Spwu-b85FsENLVENqxbgHFtnvy4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=8pdUF3i9H7o:vblxy-DzE5Q:iuKBeV4sXr0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=8pdUF3i9H7o:vblxy-DzE5Q:iuKBeV4sXr0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=8pdUF3i9H7o:vblxy-DzE5Q:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=8pdUF3i9H7o:vblxy-DzE5Q:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=8pdUF3i9H7o:vblxy-DzE5Q:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=8pdUF3i9H7o:vblxy-DzE5Q:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=8pdUF3i9H7o:vblxy-DzE5Q:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=8pdUF3i9H7o:vblxy-DzE5Q:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=8pdUF3i9H7o:vblxy-DzE5Q:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Dotnetexpertguide/~4/8pdUF3i9H7o" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.dotnetexpertguide.com/feeds/6852007090076128614/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.dotnetexpertguide.com/2011/08/iis-7-redirect-domaincom-to.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/6852007090076128614?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/6852007090076128614?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Dotnetexpertguide/~3/8pdUF3i9H7o/iis-7-redirect-domaincom-to.html" title="IIS 7 : Redirect domain.com to www.domain.com" /><author><name>Nandip Makwana</name><uri>https://profiles.google.com/100983452498554383356</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-pDb4IK6WZRs/AAAAAAAAAAI/AAAAAAAAAf4/0K7LrsiXehI/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-mYSiPBNkCs0/Tk6Ms7qlnMI/AAAAAAAAATc/cYowRlmGgXg/s72-c/1+iis+URL+rewrite.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.dotnetexpertguide.com/2011/08/iis-7-redirect-domaincom-to.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEACSX84fSp7ImA9WhdQE0Q.&quot;"><id>tag:blogger.com,1999:blog-7819331473560289523.post-5054052114174623801</id><published>2011-08-15T12:47:00.001+05:30</published><updated>2011-08-15T12:49:28.135+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-15T12:49:28.135+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="IIS" /><category scheme="http://www.blogger.com/atom/ns#" term="IIS 7" /><category scheme="http://www.blogger.com/atom/ns#" term="Remote IIS" /><title>Connect to remote site through remote IIS manager</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
I was about to blog how we can redirect &lt;b&gt;domain.com&lt;/b&gt; to &lt;b&gt;www.domain.com&lt;/b&gt; (redirecting can improve SEO ranking, tune to next post for more detail) in IIS 7. But before that I thought let me first blog how to connect with remote website through IIS manager. Before proceeding with this tutorial we need to download &lt;a target="_blank" href="http://www.iis.net/download/IISManager"&gt;IIS Manager for Remote Administration&lt;/a&gt; and of course windows hosting account which allow remote IIS management. After installing IIS Manager for Remote Administration open IIS Manager by typing &lt;b&gt;inetmgr&lt;/b&gt; in &lt;b&gt;Run&lt;/b&gt; window. In connection pane of IIS manager click on &lt;b&gt;Create New Connection&lt;/b&gt; button. There are three different options. Click on &lt;b&gt;Connect to a Site…&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-AhoKzmJL5E4/TkjEEYixcQI/AAAAAAAAASg/mYDgVHVofDo/s1600/1_iis_connection_pane.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-AhoKzmJL5E4/TkjEEYixcQI/AAAAAAAAASg/mYDgVHVofDo/s1600/1_iis_connection_pane.png" /&gt;&lt;/a&gt;&lt;/div&gt;
It will open new dialog box for connecting to remote website. In that dialog box enter &lt;b&gt;server name&lt;/b&gt; and &lt;b&gt;website name&lt;/b&gt; (which can be obtained from hosting control panel or contact hosting provider).
&lt;/div&gt;
&lt;br /&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-i24_AUQTisU/TkjEGD1I2qI/AAAAAAAAASk/FW5dC4UwXE8/s1600/2_iis_connect_to_site.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="481" src="http://4.bp.blogspot.com/-i24_AUQTisU/TkjEGD1I2qI/AAAAAAAAASk/FW5dC4UwXE8/s640/2_iis_connect_to_site.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
Clicking on next will ask for credentials for connecting to website.
&lt;/div&gt;
&lt;br /&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-h48zap0uVCY/TkjEHpQentI/AAAAAAAAASo/j03BCaZZrH4/s1600/3_iis_credentials.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="483" src="http://2.bp.blogspot.com/-h48zap0uVCY/TkjEHpQentI/AAAAAAAAASo/j03BCaZZrH4/s640/3_iis_credentials.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
After providing credentials when you click next, you might get server certificate alert depends on connecting server certificate. If you get one then click on connect if you trust connecting server.
&lt;/div&gt;
&lt;br /&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-L2B0ffr1RwY/TkjEJKCl5PI/AAAAAAAAASs/5OhXtfQALNU/s1600/4_iis_server_certificate.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="482" src="http://1.bp.blogspot.com/-L2B0ffr1RwY/TkjEJKCl5PI/AAAAAAAAASs/5OhXtfQALNU/s640/4_iis_server_certificate.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
On successful connection, it will ask for connection name. Provide connection name and click on finish button.
&lt;/div&gt;
&lt;br /&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-TqkyC3KRCHk/TkjELKq6kAI/AAAAAAAAASw/_SYtJVWJUOk/s1600/5_iis_connection_name.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="484" src="http://4.bp.blogspot.com/-TqkyC3KRCHk/TkjELKq6kAI/AAAAAAAAASw/_SYtJVWJUOk/s640/5_iis_connection_name.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
On connection, you might get following dialog asking to install server feature. This is the list of server feature which is not available on your local machine. If you want to manage / configure that feature through remote IIS then you must install it on your local machine.
&lt;/div&gt;
&lt;br /&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-tcXXFnSoyD8/TkjEMvz-p3I/AAAAAAAAAS0/jaJgXeMGFGM/s1600/6_iis_dependent_features.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-tcXXFnSoyD8/TkjEMvz-p3I/AAAAAAAAAS0/jaJgXeMGFGM/s1600/6_iis_dependent_features.png" /&gt;&lt;/a&gt;&lt;/div&gt;
After that you can see list of IIS feature available. Now you can configure it.
&lt;/div&gt;
&lt;br /&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-F5atgSgRquU/TkjEPGXjCVI/AAAAAAAAAS4/NO22eJO6IgY/s1600/7_iis_site_features.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="382" src="http://4.bp.blogspot.com/-F5atgSgRquU/TkjEPGXjCVI/AAAAAAAAAS4/NO22eJO6IgY/s640/7_iis_site_features.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
If you have any query regarding this or any other IIS feature then do let me know in comment thread so I can blog about it.&lt;/div&gt;
&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7819331473560289523-5054052114174623801?l=www.dotnetexpertguide.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/l-2u3HUsUc9jkGpE8QRPWuyxNBs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/l-2u3HUsUc9jkGpE8QRPWuyxNBs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/l-2u3HUsUc9jkGpE8QRPWuyxNBs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/l-2u3HUsUc9jkGpE8QRPWuyxNBs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=JwABWnJhObM:hAYAd3LIwgQ:iuKBeV4sXr0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=JwABWnJhObM:hAYAd3LIwgQ:iuKBeV4sXr0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=JwABWnJhObM:hAYAd3LIwgQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=JwABWnJhObM:hAYAd3LIwgQ:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=JwABWnJhObM:hAYAd3LIwgQ:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=JwABWnJhObM:hAYAd3LIwgQ:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=JwABWnJhObM:hAYAd3LIwgQ:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=JwABWnJhObM:hAYAd3LIwgQ:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=JwABWnJhObM:hAYAd3LIwgQ:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Dotnetexpertguide/~4/JwABWnJhObM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.dotnetexpertguide.com/feeds/5054052114174623801/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.dotnetexpertguide.com/2011/08/connect-to-remote-site-through-remote.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/5054052114174623801?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/5054052114174623801?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Dotnetexpertguide/~3/JwABWnJhObM/connect-to-remote-site-through-remote.html" title="Connect to remote site through remote IIS manager" /><author><name>Nandip Makwana</name><uri>https://profiles.google.com/100983452498554383356</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-pDb4IK6WZRs/AAAAAAAAAAI/AAAAAAAAAf4/0K7LrsiXehI/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-AhoKzmJL5E4/TkjEEYixcQI/AAAAAAAAASg/mYDgVHVofDo/s72-c/1_iis_connection_pane.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.dotnetexpertguide.com/2011/08/connect-to-remote-site-through-remote.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkEGRngzfSp7ImA9WhRTFk4.&quot;"><id>tag:blogger.com,1999:blog-7819331473560289523.post-2271706492174272067</id><published>2011-07-06T22:35:00.001+05:30</published><updated>2011-11-07T07:20:27.685+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-07T07:20:27.685+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ASP .NET" /><title>ASP.NET 4.0 : Visualize Response.RedirectPermanent</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div style="text-align: justify;"&gt;
In ASP.NET 4.0 there are new features that enable developer to make SEO friendly websites very easily. And if you google out, you will find plenty of article which explain this feature. But I am more interested in &lt;b&gt;Response.RedirectPermanent&lt;/b&gt;. As the name suggest it is used to redirect permanently moved resources to new location. And most of all articles on the net just explain this with some example. But how can we visualize that whether resource is redirected permanently or not. So here is the answer for that. I have used FireBug to examine the same.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Whenever we redirect with &lt;b&gt;Response.Redirect&lt;/b&gt;, we can see following activity in FireBug console.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;img border="0" src="http://3.bp.blogspot.com/-CRmXxXufLM0/ThSTr4bATUI/AAAAAAAAARg/Thrt3yqpXAE/s1600/Redirect.png" /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
As we can see that page which issues &lt;b&gt;Response.Redirect&lt;/b&gt; its response status code 302(Found) which means requested url(default.aspx) is found but it is temporarily moved to about.aspx. More information on HTTP status code can be found &lt;a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html" target="_blank"&gt;here&lt;/a&gt;.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Now whenever we redirect with &lt;b&gt;Response.RedirectPermanent&lt;/b&gt;, we can see following activity in FireBug console.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;img border="0" src="http://1.bp.blogspot.com/-BZBQvLswa5w/ThSTtroxjpI/AAAAAAAAARk/OvTSZaqVSI8/s1600/RedirectPermanent.png" /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
As we can see that page which issues &lt;b&gt;Response.RedirectPermanent&lt;/b&gt; its response status code 301(Moved Permanently) which means requested url(default.aspx) is moved Permanently to about.aspx. 301 status code is used by search engine crawler to update search index to new moved information.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
I hope information provided here would be more helpful to distinguish between &lt;b&gt;Response.Redirect&lt;/b&gt; and &lt;b&gt;Response.RedirectPermanent&lt;/b&gt;.&lt;/div&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7819331473560289523-2271706492174272067?l=www.dotnetexpertguide.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/QWAB5hBE3faiJY32-YXQp6_u8Rw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QWAB5hBE3faiJY32-YXQp6_u8Rw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/QWAB5hBE3faiJY32-YXQp6_u8Rw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QWAB5hBE3faiJY32-YXQp6_u8Rw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=5yy1OUrSZD4:KBlvOPdx-Pg:iuKBeV4sXr0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=5yy1OUrSZD4:KBlvOPdx-Pg:iuKBeV4sXr0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=5yy1OUrSZD4:KBlvOPdx-Pg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=5yy1OUrSZD4:KBlvOPdx-Pg:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=5yy1OUrSZD4:KBlvOPdx-Pg:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=5yy1OUrSZD4:KBlvOPdx-Pg:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=5yy1OUrSZD4:KBlvOPdx-Pg:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=5yy1OUrSZD4:KBlvOPdx-Pg:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=5yy1OUrSZD4:KBlvOPdx-Pg:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Dotnetexpertguide/~4/5yy1OUrSZD4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.dotnetexpertguide.com/feeds/2271706492174272067/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.dotnetexpertguide.com/2011/07/aspnet-40-visualize-responseredirectper.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/2271706492174272067?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/2271706492174272067?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Dotnetexpertguide/~3/5yy1OUrSZD4/aspnet-40-visualize-responseredirectper.html" title="ASP.NET 4.0 : Visualize Response.RedirectPermanent" /><author><name>Nandip Makwana</name><uri>https://profiles.google.com/100983452498554383356</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-pDb4IK6WZRs/AAAAAAAAAAI/AAAAAAAAAf4/0K7LrsiXehI/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-CRmXxXufLM0/ThSTr4bATUI/AAAAAAAAARg/Thrt3yqpXAE/s72-c/Redirect.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.dotnetexpertguide.com/2011/07/aspnet-40-visualize-responseredirectper.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkQCQ389cCp7ImA9WhdXGEw.&quot;"><id>tag:blogger.com,1999:blog-7819331473560289523.post-2851300725568907229</id><published>2011-05-24T17:05:00.014+05:30</published><updated>2011-08-31T22:36:02.168+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-31T22:36:02.168+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="C-Sharp" /><category scheme="http://www.blogger.com/atom/ns#" term="ASP .NET" /><title>Validate uploaded image content in ASP.NET</title><content type="html">&lt;script type="text/javascript"&gt;
    if (window.location.href == "http://www.dotnetexpertguide.com/2011/05/validate-uploaded-image-content-in.html?m=1") {
        window.location.href = "http://www.dotnetexpertguide.com/2011/05/validate-uploaded-image-content-in.html"
    }
&lt;/script&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
A very few day ago i had to face the situation where hacker uploaded the malicious ASP script to the web server by changing its extension to .JPG through user interface which allow user to upload image file. Although developer team had put the validation on extension. But unfortunately extension of ASP script was .JPG and hence it is allowed extension. So hacker could upload that malicious script.&lt;br /&gt;
&lt;br /&gt;
After this situation i thought just checking only extension for uploaded file is not the sufficient. We need to check content as well of the uploaded file.&lt;br /&gt;
&lt;br /&gt;
So i decided to check header information in uploaded image file. If it found valid header information then only save uploaded file otherwise discard uploaded file.  After Digging couple of hour on &lt;a href="http://www.wotsit.org/" target="_blank"&gt;http://www.wotsit.org&lt;/a&gt;(I am fan of &lt;a href="http://www.wotsit.org/" target="_blank"&gt;www.wotsit.org&lt;/a&gt; for more than 5 years), found following Header Information about different image file format.&lt;br /&gt;
&lt;br /&gt;
&lt;table border="0" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; margin: auto auto auto 2.75pt;"&gt;&lt;thead&gt;
&lt;tr&gt; &lt;td colspan="4" style="background-color: transparent; border: 1pt solid black; padding: 2.75pt; width: 309.95pt;" valign="top" width="413"&gt;&lt;div class="TableHeading" style="margin: 0in 0in 0pt;"&gt;
&lt;span style="font-family: Arial; font-size: 10pt; font-style: normal;"&gt;&lt;b&gt;Image  File Header Information Table&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/thead&gt; &lt;tbody&gt;
&lt;tr&gt; &lt;td style="background-color: transparent; border-color: rgb(212, 208, 200) rgb(212, 208, 200) black black; border-style: none none solid solid; border-width: medium medium 1pt 1pt; padding: 2.75pt; width: 73.5pt;" valign="top" width="98"&gt;&lt;div class="TableHeading" style="margin: 0in 0in 0pt;"&gt;
&lt;span style="font-family: Arial; font-size: 10pt; font-style: normal;"&gt;&lt;b&gt;File  Format&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;td style="background-color: transparent; border-color: rgb(212, 208, 200) rgb(212, 208, 200) black black; border-style: none none solid solid; border-width: medium medium 1pt 1pt; padding: 2.75pt; width: 52.5pt;" valign="top" width="70"&gt;&lt;div class="TableHeading" style="margin: 0in 0in 0pt;"&gt;
&lt;span style="font-family: Arial; font-size: 10pt; font-style: normal;"&gt;&lt;b&gt;Offset&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;td style="background-color: transparent; border-color: rgb(212, 208, 200) rgb(212, 208, 200) black black; border-style: none none solid solid; border-width: medium medium 1pt 1pt; padding: 2.75pt; width: 65.25pt;" valign="top" width="87"&gt;&lt;div class="TableHeading" style="margin: 0in 0in 0pt;"&gt;
&lt;span style="font-family: Arial; font-size: 10pt; font-style: normal;"&gt;&lt;b&gt;Length&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;td style="background-color: transparent; border-color: rgb(212, 208, 200) black black; border-style: none solid solid; border-width: medium 1pt 1pt; padding: 2.75pt; width: 118.7pt;" valign="top" width="158"&gt;&lt;div class="TableHeading" style="margin: 0in 0in 0pt;"&gt;
&lt;span style="font-family: Arial; font-size: 10pt; font-style: normal;"&gt;&lt;b&gt;Value&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;td style="background-color: transparent; border-color: rgb(212, 208, 200) rgb(212, 208, 200) black black; border-style: none none solid solid; border-width: medium medium 1pt 1pt; padding: 2.75pt; width: 73.5pt;" valign="top" width="98"&gt;&lt;div class="TableContents" style="margin: 0in 0in 0pt;"&gt;
&lt;span style="font-family: Arial; font-size: 10pt;"&gt;JPG  / JPEG&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;td style="background-color: transparent; border-color: rgb(212, 208, 200) rgb(212, 208, 200) black black; border-style: none none solid solid; border-width: medium medium 1pt 1pt; padding: 2.75pt; width: 52.5pt;" valign="top" width="70"&gt;&lt;div class="TableContents" style="margin: 0in 0in 0pt;"&gt;
&lt;span style="font-family: Arial; font-size: 10pt;"&gt;0&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;td style="background-color: transparent; border-color: rgb(212, 208, 200) rgb(212, 208, 200) black black; border-style: none none solid solid; border-width: medium medium 1pt 1pt; padding: 2.75pt; width: 65.25pt;" valign="top" width="87"&gt;&lt;div class="TableContents" style="margin: 0in 0in 0pt;"&gt;
&lt;span style="font-family: Arial; font-size: 10pt;"&gt;4&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;td style="background-color: transparent; border-color: rgb(212, 208, 200) black black; border-style: none solid solid; border-width: medium 1pt 1pt; padding: 2.75pt; width: 118.7pt;" valign="top" width="158"&gt;&lt;div class="TableContents" style="margin: 0in 0in 0pt;"&gt;
&lt;span style="font-family: Arial; font-size: 10pt;"&gt;0xFF,  0xD8, 0xFF, 0xE0&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;td style="background-color: transparent; border-color: rgb(212, 208, 200) rgb(212, 208, 200) black black; border-style: none none solid solid; border-width: medium medium 1pt 1pt; padding: 2.75pt; width: 73.5pt;" valign="top" width="98"&gt;&lt;div class="TableContents" style="margin: 0in 0in 0pt;"&gt;
&lt;span style="font-family: Arial; font-size: 10pt;"&gt;PNG&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;td style="background-color: transparent; border-color: rgb(212, 208, 200) rgb(212, 208, 200) black black; border-style: none none solid solid; border-width: medium medium 1pt 1pt; padding: 2.75pt; width: 52.5pt;" valign="top" width="70"&gt;&lt;div class="TableContents" style="margin: 0in 0in 0pt;"&gt;
&lt;span style="font-family: Arial; font-size: 10pt;"&gt;0&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;td style="background-color: transparent; border-color: rgb(212, 208, 200) rgb(212, 208, 200) black black; border-style: none none solid solid; border-width: medium medium 1pt 1pt; padding: 2.75pt; width: 65.25pt;" valign="top" width="87"&gt;&lt;div class="TableContents" style="margin: 0in 0in 0pt;"&gt;
&lt;span style="font-family: Arial; font-size: 10pt;"&gt;4&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;td style="background-color: transparent; border-color: rgb(212, 208, 200) black black; border-style: none solid solid; border-width: medium 1pt 1pt; padding: 2.75pt; width: 118.7pt;" valign="top" width="158"&gt;&lt;div class="TableContents" style="margin: 0in 0in 0pt;"&gt;
&lt;span style="font-family: Arial; font-size: 10pt;"&gt;0x89,  0x50, 0x4E, 0x47&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;td style="background-color: transparent; border-color: rgb(212, 208, 200) rgb(212, 208, 200) black black; border-style: none none solid solid; border-width: medium medium 1pt 1pt; padding: 2.75pt; width: 73.5pt;" valign="top" width="98"&gt;&lt;div class="TableContents" style="margin: 0in 0in 0pt;"&gt;
&lt;span style="font-family: Arial; font-size: 10pt;"&gt;TIF  / TIFF&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;td style="background-color: transparent; border-color: rgb(212, 208, 200) rgb(212, 208, 200) black black; border-style: none none solid solid; border-width: medium medium 1pt 1pt; padding: 2.75pt; width: 52.5pt;" valign="top" width="70"&gt;&lt;div class="TableContents" style="margin: 0in 0in 0pt;"&gt;
&lt;span style="font-family: Arial; font-size: 10pt;"&gt;0&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;td style="background-color: transparent; border-color: rgb(212, 208, 200) rgb(212, 208, 200) black black; border-style: none none solid solid; border-width: medium medium 1pt 1pt; padding: 2.75pt; width: 65.25pt;" valign="top" width="87"&gt;&lt;div class="TableContents" style="margin: 0in 0in 0pt;"&gt;
&lt;span style="font-family: Arial; font-size: 10pt;"&gt;4&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;td style="background-color: transparent; border-color: rgb(212, 208, 200) black black; border-style: none solid solid; border-width: medium 1pt 1pt; padding: 2.75pt; width: 118.7pt;" valign="top" width="158"&gt;&lt;div class="TableContents" style="margin: 0in 0in 0pt;"&gt;
&lt;span style="font-family: Arial; font-size: 10pt;"&gt;0x49,  0x49, 0x2A, 0x00&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;td style="background-color: transparent; border-color: rgb(212, 208, 200) rgb(212, 208, 200) black black; border-style: none none solid solid; border-width: medium medium 1pt 1pt; padding: 2.75pt; width: 73.5pt;" valign="top" width="98"&gt;&lt;div class="TableContents" style="margin: 0in 0in 0pt;"&gt;
&lt;span style="font-family: Arial; font-size: 10pt;"&gt;GIF&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;td style="background-color: transparent; border-color: rgb(212, 208, 200) rgb(212, 208, 200) black black; border-style: none none solid solid; border-width: medium medium 1pt 1pt; padding: 2.75pt; width: 52.5pt;" valign="top" width="70"&gt;&lt;div class="TableContents" style="margin: 0in 0in 0pt;"&gt;
&lt;span style="font-family: Arial; font-size: 10pt;"&gt;0&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;td style="background-color: transparent; border-color: rgb(212, 208, 200) rgb(212, 208, 200) black black; border-style: none none solid solid; border-width: medium medium 1pt 1pt; padding: 2.75pt; width: 65.25pt;" valign="top" width="87"&gt;&lt;div class="TableContents" style="margin: 0in 0in 0pt;"&gt;
&lt;span style="font-family: Arial; font-size: 10pt;"&gt;4&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;td style="background-color: transparent; border-color: rgb(212, 208, 200) black black; border-style: none solid solid; border-width: medium 1pt 1pt; padding: 2.75pt; width: 118.7pt;" valign="top" width="158"&gt;&lt;div class="TableContents" style="margin: 0in 0in 0pt;"&gt;
&lt;span style="font-family: Arial; font-size: 10pt;"&gt;0x47,  0x49, 0x46, 0x38&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;td style="background-color: transparent; border-color: rgb(212, 208, 200) rgb(212, 208, 200) black black; border-style: none none solid solid; border-width: medium medium 1pt 1pt; padding: 2.75pt; width: 73.5pt;" valign="top" width="98"&gt;&lt;div class="TableContents" style="margin: 0in 0in 0pt;"&gt;
&lt;span style="font-family: Arial; font-size: 10pt;"&gt;BMP&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;td style="background-color: transparent; border-color: rgb(212, 208, 200) rgb(212, 208, 200) black black; border-style: none none solid solid; border-width: medium medium 1pt 1pt; padding: 2.75pt; width: 52.5pt;" valign="top" width="70"&gt;&lt;div class="TableContents" style="margin: 0in 0in 0pt;"&gt;
&lt;span style="font-family: Arial; font-size: 10pt;"&gt;0&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;td style="background-color: transparent; border-color: rgb(212, 208, 200) rgb(212, 208, 200) black black; border-style: none none solid solid; border-width: medium medium 1pt 1pt; padding: 2.75pt; width: 65.25pt;" valign="top" width="87"&gt;&lt;div class="TableContents" style="margin: 0in 0in 0pt;"&gt;
&lt;span style="font-family: Arial; font-size: 10pt;"&gt;2&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;td style="background-color: transparent; border-color: rgb(212, 208, 200) black black; border-style: none solid solid; border-width: medium 1pt 1pt; padding: 2.75pt; width: 118.7pt;" valign="top" width="158"&gt;&lt;div class="TableContents" style="margin: 0in 0in 0pt;"&gt;
&lt;span style="font-family: Arial; font-size: 10pt;"&gt;0x42,  0x4D&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;td style="background-color: transparent; border-color: rgb(212, 208, 200) rgb(212, 208, 200) black black; border-style: none none solid solid; border-width: medium medium 1pt 1pt; padding: 2.75pt; width: 73.5pt;" valign="top" width="98"&gt;&lt;div class="TableContents" style="margin: 0in 0in 0pt;"&gt;
&lt;span style="font-family: Arial; font-size: 10pt;"&gt;ICO&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;td style="background-color: transparent; border-color: rgb(212, 208, 200) rgb(212, 208, 200) black black; border-style: none none solid solid; border-width: medium medium 1pt 1pt; padding: 2.75pt; width: 52.5pt;" valign="top" width="70"&gt;&lt;div class="TableContents" style="margin: 0in 0in 0pt;"&gt;
&lt;span style="font-family: Arial; font-size: 10pt;"&gt;0&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;td style="background-color: transparent; border-color: rgb(212, 208, 200) rgb(212, 208, 200) black black; border-style: none none solid solid; border-width: medium medium 1pt 1pt; padding: 2.75pt; width: 65.25pt;" valign="top" width="87"&gt;&lt;div class="TableContents" style="margin: 0in 0in 0pt;"&gt;
&lt;span style="font-family: Arial; font-size: 10pt;"&gt;4&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;td style="background-color: transparent; border-color: rgb(212, 208, 200) black black; border-style: none solid solid; border-width: medium 1pt 1pt; padding: 2.75pt; width: 118.7pt;" valign="top" width="158"&gt;&lt;div class="TableContents" style="margin: 0in 0in 0pt;"&gt;
&lt;span style="font-family: Arial; font-size: 10pt;"&gt;0x00,  0x00, 0x01, 0x00&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
Instead of checking only header, we could also check whole file content against its file format. But checking only header could serve our purpose and it is also speedy process than checking whole file content so i am not checking whole file content.&lt;br /&gt;
&lt;br /&gt;
Following code snippet validate header of known image types (JPG, PNG, TIFF, GIF, BMP, ICO) Please do let me know if i have missed any image types.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;NOTE:&lt;/b&gt; In code snippet &lt;b&gt;fuImage&lt;/b&gt; refer to ASP.NET file upload control&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: csharp"&gt;protected void btnUpload_Click(object sender, EventArgs e)
{
    // DICTIONARY OF ALL IMAGE FILE HEADER
    Dictionary&amp;lt;string, byte[]&amp;gt; imageHeader = new Dictionary&amp;lt;string, byte[]&amp;gt;();
    imageHeader.Add("JPG", new byte[] { 0xFF, 0xD8, 0xFF, 0xE0 });
    imageHeader.Add("JPEG", new byte[] { 0xFF, 0xD8, 0xFF, 0xE0 });
    imageHeader.Add("PNG", new byte[] { 0x89, 0x50, 0x4E, 0x47 });
    imageHeader.Add("TIF", new byte[] { 0x49, 0x49, 0x2A, 0x00 });
    imageHeader.Add("TIFF", new byte[] { 0x49, 0x49, 0x2A, 0x00 });
    imageHeader.Add("GIF", new byte[] { 0x47, 0x49, 0x46, 0x38 });
    imageHeader.Add("BMP", new byte[] { 0x42, 0x4D });
    imageHeader.Add("ICO", new byte[] { 0x00, 0x00, 0x01, 0x00 });

    byte[] header;
    if (fuImage.HasFile)
    {
        // GET FILE EXTENSION
        string fileExt;
        fileExt = fuImage.FileName.Substring(fuImage.FileName.LastIndexOf('.') + 1).ToUpper();

        // CUSTOM VALIDATION GOES HERE BASED ON FILE EXTENSION IF ANY
        
        byte[] tmp = imageHeader[fileExt];
        header = new byte[tmp.Length];

        // GET HEADER INFORMATION OF UPLOADED FILE
        fuImage.FileContent.Read(header, 0, header.Length);

        if (CompareArray(tmp, header))
        {
            lblMessage.Text = "Valid ." + fileExt + " file.";
            // VALID HEADER INFORMATION 
            // CODE TO PROCESS FILE
        }
        else
        {
            lblMessage.Text = "Invalid ." + fileExt + " file.";
            // INVALID HEADER INFORMATION
        }
    }
    else
    {
        lblMessage.Text = "Please select image file.";
    }
}

private bool CompareArray(byte[] a1, byte[] a2)
{
    if (a1.Length != a2.Length)
        return false;

    for (int i = 0; i &amp;lt; a1.Length; i++)
    {
        if (a1[i] != a2[i])
            return false;
    }

    return true;
}&lt;/pre&gt;
Any input on above is greatly appreciated... &lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://feeds.feedburner.com/Dotnetexpertguide"&gt;&lt;img src="http://2.bp.blogspot.com/-pU9va9j6CRM/TXVqXVqF78I/AAAAAAAAETk/Om3018umd6c/rss_32.png" height="16" width="16" style="border-width:0px;" /&gt; Subscribe via RSS&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://www.facebook.com/dotnetExpertGuide"&gt;&lt;img src="http://1.bp.blogspot.com/-1SHrcXai4U8/TXVqXLy5_iI/AAAAAAAAETc/oxSLPBnPQvc/facebook_32.png" height="16" width="16" style="border-width:0px;" /&gt; Like us on Facebook&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://twitter.com/dotnetXPRTGuide"&gt;&lt;img src="http://4.bp.blogspot.com/-ASykdggJLF0/TXVqfONMDsI/AAAAAAAAET8/pqEyxcfG1Yc/twitter_32.png" height="16" width="16" style="border-width:0px;" /&gt; Follow us on Twitter&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://feedburner.google.com/fb/a/mailverify?uri=Dotnetexpertguide"&gt;&lt;img src="http://1.bp.blogspot.com/-PZs2wKjVkYo/TXVqXNIlQkI/AAAAAAAAETU/H20hbb9BsDw/email_32.png" height="16" width="16" style="border-width:0px;" /&gt; Subscribe via Email&lt;/a&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7819331473560289523-2851300725568907229?l=www.dotnetexpertguide.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/bF2YE672WkF_XAuond4GNhCpedE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/bF2YE672WkF_XAuond4GNhCpedE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/bF2YE672WkF_XAuond4GNhCpedE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/bF2YE672WkF_XAuond4GNhCpedE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=-QgwbSbq1bk:tUt-f8IRSY4:iuKBeV4sXr0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=-QgwbSbq1bk:tUt-f8IRSY4:iuKBeV4sXr0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=-QgwbSbq1bk:tUt-f8IRSY4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=-QgwbSbq1bk:tUt-f8IRSY4:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=-QgwbSbq1bk:tUt-f8IRSY4:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=-QgwbSbq1bk:tUt-f8IRSY4:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=-QgwbSbq1bk:tUt-f8IRSY4:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Dotnetexpertguide?a=-QgwbSbq1bk:tUt-f8IRSY4:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Dotnetexpertguide?i=-QgwbSbq1bk:tUt-f8IRSY4:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Dotnetexpertguide/~4/-QgwbSbq1bk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.dotnetexpertguide.com/feeds/2851300725568907229/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.dotnetexpertguide.com/2011/05/validate-uploaded-image-content-in.html#comment-form" title="5 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/2851300725568907229?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7819331473560289523/posts/default/2851300725568907229?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Dotnetexpertguide/~3/-QgwbSbq1bk/validate-uploaded-image-content-in.html" title="Validate uploaded image content in ASP.NET" /><author><name>Nandip Makwana</name><uri>https://profiles.google.com/100983452498554383356</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-pDb4IK6WZRs/AAAAAAAAAAI/AAAAAAAAAf4/0K7LrsiXehI/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-pU9va9j6CRM/TXVqXVqF78I/AAAAAAAAETk/Om3018umd6c/s72-c/rss_32.png" height="72" width="72" /><thr:total>5</thr:total><feedburner:origLink>http://www.dotnetexpertguide.com/2011/05/validate-uploaded-image-content-in.html</feedburner:origLink></entry></feed>

