Changing VS2005 to generate HTML 4.01/Strict instead of XHTML 1.0

Discussion in 'ASP .Net' started by Rob Roberts, Jan 20, 2006.

  1. Rob Roberts

    Rob Roberts Guest

    Is there any way to change VS2005 to generate HTML 4.01/Strict instead of
    XHTML 1.0/Transititional? VS2005 puts a DOCTYPE statement specifying XHTML
    1.0/Transitional at the top of every new aspx page. Is there any way to
    change it to specify an HTML 4.01/Strict DOCTYPE instead?

    Thanks in advance,
    --Rob Roberts
     
    Rob Roberts, Jan 20, 2006
    #1
    1. Advertising

  2. Rob Roberts

    Teemu Keiski Guest

    Hi,

    if legacy rendering similarly to ASP.NET 1.1 would be enough then setting
    <xhtmlConformance mode="Legacy"> element in web.config. Otherwise you are
    probably looking for developing your own adapter / HtmlTextWriter.

    Architectural Overview of Adaptive Control Behavior
    http://msdn2.microsoft.com/en-us/library/67276kc5.aspx

    --
    Teemu Keiski
    ASP.NET MVP, AspInsider
    Finland, EU
    http://blogs.aspadvice.com/joteke

    "Rob Roberts" <> wrote in message
    news:%...
    > Is there any way to change VS2005 to generate HTML 4.01/Strict instead of
    > XHTML 1.0/Transititional? VS2005 puts a DOCTYPE statement specifying
    > XHTML 1.0/Transitional at the top of every new aspx page. Is there any
    > way to change it to specify an HTML 4.01/Strict DOCTYPE instead?
    >
    > Thanks in advance,
    > --Rob Roberts
    >
    >
     
    Teemu Keiski, Jan 20, 2006
    #2
    1. Advertising

  3. Rob Roberts

    Kim Quigley Guest

    Hello,

    Would the following solution apply?

    Open an aspx page in Source view. Go to View > Toolbars and make sure "HTML
    Source Editing" is selected. Look for a drop down list in the toolbar.

    Select "HTML 4.01" from that drop down list.

    Kim
     
    Kim Quigley, Jan 20, 2006
    #3
  4. Rob Roberts

    Rob Roberts Guest

    Kim,

    > Would the following solution apply?
    >
    > Open an aspx page in Source view. Go to View > Toolbars and make sure
    > "HTML Source Editing" is selected. Look for a drop down list in the
    > toolbar.
    >
    > Select "HTML 4.01" from that drop down list.


    That seems to only affect the HTML validation that the IDE does, exactly the
    same as the Text Editor/HTML/Validation/Target option under Tools/Options.
    (If you hover your mouse over the drop down list in the HTML Source Editing
    toolbar, a hint pops up that says"Target Schema for Validation". It doesn't
    seem to affect the DOCTYPE that gets added at the top of new aspx pages.
    Even if "HTML 4.01" is selected in the drop down list, new aspx pages still
    end up with a DOCTYPE of XHTML 1.0 Transitional.

    Or am I missing something?

    Thanks,
    --Rob Roberts
     
    Rob Roberts, Jan 20, 2006
    #4
  5. Rob Roberts

    Kim Quigley Guest

    I was having a problem yesterday that related to the doctype. I was trying
    to set the height of a table to 100%, but XHTML doesn't support the height
    attribute. (see http://www.bernzilla.com/item.php?id=116 if interested)

    I did change the target schema for validation as I suggested, but now I
    remember what I did that actually made a difference. I added a MasterPage
    file and applied it to all of my pages. Then you only have to change the
    doctype that is in the MasterPage. In my case, I just deleted the doctype
    tag from the MasterPage file.

    Sorry about the misinformation! I know that this solution does not
    ultimately answer your question of whether or not you can change the default
    doctype, but maybe it will be a workaround that you can use.

    Kim

    "Rob Roberts" <> wrote in message
    news:uXg0$...
    > Kim,
    >
    >> Would the following solution apply?
    >>
    >> Open an aspx page in Source view. Go to View > Toolbars and make sure
    >> "HTML Source Editing" is selected. Look for a drop down list in the
    >> toolbar.
    >>
    >> Select "HTML 4.01" from that drop down list.

    >
    > That seems to only affect the HTML validation that the IDE does, exactly
    > the same as the Text Editor/HTML/Validation/Target option under
    > Tools/Options. (If you hover your mouse over the drop down list in the
    > HTML Source Editing toolbar, a hint pops up that says"Target Schema for
    > Validation". It doesn't seem to affect the DOCTYPE that gets added at the
    > top of new aspx pages. Even if "HTML 4.01" is selected in the drop down
    > list, new aspx pages still end up with a DOCTYPE of XHTML 1.0
    > Transitional.
    >
    > Or am I missing something?
    >
    > Thanks,
    > --Rob Roberts
    >
    >
     
    Kim Quigley, Jan 20, 2006
    #5
  6. Rob Roberts

    Rob Roberts Guest

    Kim,

    Thanks for the additional information. I'm also using a MasterPage, and I
    did change the doctype in it, but I was still wondering whether the default
    doctype for new pages that don't use this MasterPage could be changed. I
    guess it isn't possible...

    --Rob Roberts

    "Kim Quigley" <> wrote in message
    news:...
    >I was having a problem yesterday that related to the doctype. I was trying
    >to set the height of a table to 100%, but XHTML doesn't support the height
    >attribute. (see http://www.bernzilla.com/item.php?id=116 if interested)
    >
    > I did change the target schema for validation as I suggested, but now I
    > remember what I did that actually made a difference. I added a MasterPage
    > file and applied it to all of my pages. Then you only have to change the
    > doctype that is in the MasterPage. In my case, I just deleted the doctype
    > tag from the MasterPage file.
    >
    > Sorry about the misinformation! I know that this solution does not
    > ultimately answer your question of whether or not you can change the
    > default doctype, but maybe it will be a workaround that you can use.
    >
    > Kim
    >
    > "Rob Roberts" <> wrote in message
    > news:uXg0$...
    >> Kim,
    >>
    >>> Would the following solution apply?
    >>>
    >>> Open an aspx page in Source view. Go to View > Toolbars and make sure
    >>> "HTML Source Editing" is selected. Look for a drop down list in the
    >>> toolbar.
    >>>
    >>> Select "HTML 4.01" from that drop down list.

    >>
    >> That seems to only affect the HTML validation that the IDE does, exactly
    >> the same as the Text Editor/HTML/Validation/Target option under
    >> Tools/Options. (If you hover your mouse over the drop down list in the
    >> HTML Source Editing toolbar, a hint pops up that says"Target Schema for
    >> Validation". It doesn't seem to affect the DOCTYPE that gets added at
    >> the top of new aspx pages. Even if "HTML 4.01" is selected in the drop
    >> down list, new aspx pages still end up with a DOCTYPE of XHTML 1.0
    >> Transitional.
    >>
    >> Or am I missing something?
    >>
    >> Thanks,
    >> --Rob Roberts
    >>
    >>

    >
    >
     
    Rob Roberts, Jan 20, 2006
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter L.
    Replies:
    0
    Views:
    347
    Peter L.
    Oct 20, 2003
  2. Replies:
    3
    Views:
    2,099
    Teemu Keiski
    Feb 20, 2006
  3. Andy Bell

    Html 4.01 strict instead of xhtml?

    Andy Bell, Aug 7, 2007, in forum: ASP .Net
    Replies:
    5
    Views:
    726
    Steven Cheng[MSFT]
    Aug 8, 2007
  4. xhtml champs
    Replies:
    0
    Views:
    566
    xhtml champs
    Aug 1, 2011
  5. xhtml champs
    Replies:
    0
    Views:
    1,083
    xhtml champs
    Aug 2, 2011
Loading...

Share This Page