ASP.NET4.0-Compatibility Settings for rendering controls

Posted by Jalpesh P. Vadgama on ASP.net Weblogs See other posts from ASP.net Weblogs or by Jalpesh P. Vadgama
Published on Sat, 12 Jun 2010 06:47:49 GMT Indexed on 2010/06/12 6:54 UTC
Read the original article Hit count: 579

Filed under:
|
|
|

With asp.net 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 asp.net 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 asp.net 3.5 and i want to convert it in asp.net 4.0. I have applied my style as per 3.5 rendering and some of items are obsolete in asp.net 4.0. Modifying style sheet was a tedious job here asp.net 4.0 compatibility  setting comes into help.

Asp.net 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.

XML, using GeSHi 1.0.8.6
<system.web> <pages controlRenderingCompatibilityVersion="3.5|4.0"/> </system.web> 
Parsed in 0.001 seconds at 84.92 KB/s

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 asp.net 3.5.

Hope this help you!!!

Shout it

© ASP.net Weblogs or respective owner

Related posts about ASP.NET

Related posts about c#.net