ASP.NET4.0-Compatibility Settings for rendering controls

With 4.0 Microsoft has taken a great step for rendering controls. Now it will have more cleaner html there are lots of enhancement for rendering html controls in 4.0 now all controls like Menu, List View and other controls renders more cleaner html. But recently i have faced strange problem in rendering controls I have my site in 3.5 and i want to convert it in 4.0. I have applied my style as per 3.5 rendering and some of items are obsolete in 4.0. Modifying style sheet was a tedious job here 4.0 compatibility setting comes into help. 4.0 compatibility settings provides full backward compatibility in terms of the rendering controls. You can assign this in your web.config section like following.

<pages controlRenderingCompatibilityVersion="3.5|4.0"/>
Here the values of controlRenderingCompatibility is a string which will indicate on which way control should render in browser if you provide 4.0 then it will controls with more cleaner html and while if you want to go with old legacy rendering like 3.5 then you can put 3.5 and it will render same way as you are doing in 3.5.

Hope this help you!!!

Technorati Tags: ,
Shout it
kick it on


Popular posts from this blog

How to create Rest API(Web API) with ASP.NET Core 1.0

Creating PDF with ASP.Net MVC and RazorPDF

Solution: gulp is not recognized as internal or external command- Visual Studio