Saturday, June 12, 2010

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


Post a Comment

Your feedback is very important to me. Please provide your feedback via putting comments.

Support this blog-Buy me a coffee

Buy me a coffeeBuy me a coffee
Search This Blog
Subscribe to my blog


My Mvp Profile
Follow us on facebook
Blog Archive
Total Pageviews