You are here:   Home
Register   |  Login

Programmer Newsletter

Minimize

Master Programmer

Minimize

Find articles on computer software, programming, ASP.net, Sql server, databases, C#, websites, Internet, Windows, Outlook macros.

Programming Articles

Minimize
16

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

Posted in: Asp.net

Post Rating

Comments

Anonymous User
# Anonymous User
Thursday, September 16, 2010 5:42 PM
Ustream Live Video, Trust, Embed Facebook Video, Ebook Marketing

Post Comment

Name (required)

Email (required)

Website

Programmer Newsletter

Minimize

Subscribe to the Internet Handholding newsletter



Reccomend Programmer.bz

Minimize

Share/Bookmark Bookmark and Share