In ASP.NET 4.0, there are changes to the output cleanup code that include:
xhtmlConformance is Strict. Menus are displayed as lists, not tables. Extraneous properties, such as border = 0, are removed from the selected markup. Even the error text in the validation controls is no longer set to red. Now the rendering of the external table for the template controls can be controlled using the newRenderOuterTable property. For compatibility, you can make your output the same as in ASP.NET 3.5 using controlRenderingCompatibilityVersion
> <?xml version="1.0"?> <configuration> <system.web> > <compilation debug="false" targetFramework="4.0" /> > <pages controlRenderingCompatibilityVersion="3.5" /> </system.web> </configuration>
Additional information is available at http://msdn.microsoft.com/en-us/library/system.web.ui.control.renderingcompatibility.aspx .
I am so happy that I decided this. And I am surprised that I could not find more people going on the same problem. It seems that the options in my case are to use this compatibility option or set ForeColor of all my validation controls to Red. (I will probably do this last.)
source share