all groups > asp.net building controls > march 2005 >
You're in the

asp.net building controls

group:

Writing a DIV tag?


Writing a DIV tag? Andrew Backer
3/16/2005 4:50:43 PM
asp.net building controls:
Starting to mess with writing to the HtmlTextWriter, and have a
question about divs.

Why is it that HtmlTextWriterTag.Div writes a *table*, when I tell it
write a div? The tooltip help says "Specifies an HTML Div Element",
but the documentation on the tag says that it will write out a table?

Is there some *good* reason why MS doesn't want me to use a div? It
just seems reeee-diculus :)

- Andrew
Re: Writing a DIV tag? Jason Bentley
3/17/2005 9:38:36 AM
Maybe, maybe, but are you overriding the HTMLTextWriter TagKey
property?

Jason Bentley
http://geekswithblogs.net/jbentley
Re: Writing a DIV tag? Andrew Backer
3/17/2005 10:51:35 AM
I should have been a bit more liberal with info on what I am doing.
Sorry.

i'm just writing a normal webcontrol, and poking at methods on the
writer that gets past in to the RenderContents method :

override protected void RenderContents(HtmlTextWriter writer) {
... add attributes ...
writer.RenderBeginTag ( HtmlTextWriterTag.Div );
// writer.RenderBeginTag ( "div" );
writer.RenderEndTag();
}
Re: Writing a DIV tag? Showjumper
3/17/2005 9:49:01 PM
What browser are you using to view the page?
[quoted text, click to view]


Re: Writing a DIV tag? Andrew Backer
3/18/2005 3:45:36 PM
Firefox is my first test, second test is IE if that works ok.
AddThis Social Bookmark Button