Posts

Showing posts from October, 2010

ASP.NET 4.0 Feature - ClientIDMode Property

Let us see the new feature in ASP.NET 4.0 known as “ClientIDMode Property”. In the past we have seen that client id for any controls begin with “ctl00” and it always used to be a long names for eg: “gvBooks_ctl01_lnkOrderBook” . These id’s were very much needed when we used to while writing validations in javascript. Now in ASP.NET 4.0 we have the ClientIDMode Property which supports four different options as follows 1. AutoID – This is nothing but same as what we had prior to .NET 4.0 2. Predictable – This means that it concatenates the control name with the container (may be a contentplaceholder) for eg: contentplacholder1_btnSave 3. Static - This means that whatever the ID is set for the controls it uses that itself. 4. Inherit – This means that it will inherit the ClientIDMode property setting of the parent control. This is used in the different ways as seen below 1. It can be set in the web.config as <pages clientIDMode="Static"/> 2. It can be set at the control

Microsoft PDC 28th Oct - 29th Oct 2010

Microsoft PDC begins on 28th Oct. Check out for the more details http://player.microsoftpdc.com/ Cheers!!!

ASP.NET 4.0 Feature - Cleaner Markup in ASP.NET 4.0

Let us see the new feature in ASP.NET 4.0 known as the Cleaner Markup in ASP.NET 4.0 . We have a property “controlRenderingCompatbilityVersion” in the web.config which lets you decide if you want a cleaner markup. This is defaulted to “4.0” as of in ASP.NET. When we are migrating from older version this is always helpful in keeping the markups, which can be achieved by setting to 3.5 as seen below <pages controlRenderingCompatibilityVersion ="3.5"/> Hope this was cool feature. Please add your comments or suggestions. Cheers!!!

ASP.NET 4.0 Feature - Response.RedirectToRoute and Response.RedirectToRoutePermanent methods

Let us see the new feature in ASP.NET 4.0 known as the “Response.RedirectToRoute” and “Response.RedirectToRoutePermanent” methods. These helps to redirect to a specified url temporary or on permanent basis using the URL Routing mechanism. The Syntax is as follows Response.RedirectToRoute("View Titles by Author", new { TitleAuID = "172-32-1176" }); Response.RedirectToRoutePermanent("View Titles by Author", new { TitleAuID = "172-32-1176" }); Hope this was cool feature. Please add your comments or suggestions. Cheers!!!

ASP.NET 4.0 Feature - Response.RedirectPermanent() Method

Let us see the new feature in ASP.NET 4.0 known as the “Response.RedirectPermanent”. We have seen in the past where we use the “Response.Redirect” method to redirect to the requested Url to specified Url, this uses the HTTP 302 status code which is temporary redirect. This leads to a round trip from requested Url to specified Url when the user hits the requested Url. Now we have the “Response.RedirectPermanent” which uses the HTTP 301 status code which is a permanent redirect. This enables the search engines to store all the permanent redirects and index it which enables in searching it faster. The Syntax is Response.RedirectPermanent(“NewTitles.aspx”); Hope this was cool feature. Please add your comments or suggestions. Cheers!!!