Internet Handholding posted on August 16, 2010 19:30
Yikes, in Asp.net you can ask for Div tag and get a Table tag.
writer.RenderBeginTag(HtmlTextWriterTag.Div);
That sucks. In my case, I used CSS on a Div class, and the Div tag disappeared and so did my CSS styling.
This happens because Asp determined you have a downlevel browser and is trying to help you out.
The reason for this wacky behavior is explained in this excellent article.
www.aspnetresources.com/blog/adaptive_rendering_redux
When I ask for a Div tag, I want a Div tag. If a browser cannot handle a Div tag, it is so old, I do not care what it does.
My solution is to write the Div myself.
writer.Write("<div class=\" + class + \">");
Not so hard.
By Andrew Weitzen, Bronze Inc. (c) 2010
Bronze is the publisher of several online Internet journals including: InternetHandholding.com, DomainNames.gs, DotNetNuke.bz, Programmer.bz, Software.vg, WebHosting.vg