Writing a DIV tag?

Discussion in 'ASP .Net Building Controls' started by Andrew Backer, Mar 17, 2005.

  1. 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
     
    Andrew Backer, Mar 17, 2005
    #1
    1. Advertisements

  2. Jason Bentley, Mar 17, 2005
    #2
    1. Advertisements

  3. 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();
    }
     
    Andrew Backer, Mar 17, 2005
    #3
  4. Andrew Backer

    Showjumper Guest

    What browser are you using to view the page?
     
    Showjumper, Mar 18, 2005
    #4
  5. Firefox is my first test, second test is IE if that works ok.
     
    Andrew Backer, Mar 18, 2005
    #5
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.