ASP.NET inserts trailing slash in tag

Discussion in 'ASP .Net' started by Harlan Messinger, Feb 18, 2008.

  1. I created a new Web application in VS2005, and added a master page and a
    content page based on it. I replaced the default XHTML doctype directive
    with one for HTML 4.01 Strict.

    In the master page code I placed a link tag, without a slash before the
    closing ">". The compiler keeps sticking one in, so that the resulting
    page isn't valid HTML. I can't figure out how to keep the compiler from
    doing this. Please help!
    Harlan Messinger, Feb 18, 2008
    #1
    1. Advertising

  2. Harlan Messinger

    David Wier Guest

    Based on XHTML, all tags must have a closing tag, or be self-closing - why
    don't you just add the closing slash?

    David Wier
    http://aspnet101.com
    http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with no
    bloated markup


    "Harlan Messinger" <> wrote in message
    news:...
    >I created a new Web application in VS2005, and added a master page and a
    >content page based on it. I replaced the default XHTML doctype directive
    >with one for HTML 4.01 Strict.
    >
    > In the master page code I placed a link tag, without a slash before the
    > closing ">". The compiler keeps sticking one in, so that the resulting
    > page isn't valid HTML. I can't figure out how to keep the compiler from
    > doing this. Please help!
    David Wier, Feb 18, 2008
    #2
    1. Advertising

  3. David Wier wrote:
    >
    > "Harlan Messinger" <> wrote in message
    > news:...
    >> I created a new Web application in VS2005, and added a master page and a
    >> content page based on it. I replaced the default XHTML doctype directive
    >> with one for HTML 4.01 Strict.
    >>
    >> In the master page code I placed a link tag, without a slash before the
    >> closing ">". The compiler keeps sticking one in, so that the resulting
    >> page isn't valid HTML. I can't figure out how to keep the compiler from
    >> doing this. Please help!

    >
    > Based on XHTML, all tags must have a closing tag, or be self-closing - why
    > don't you just add the closing slash?
    >

    I repeat: I'm not using XHTML, I'm using HTML 4.01.
    Harlan Messinger, Feb 18, 2008
    #3
  4. Mark Rae [MVP], Feb 19, 2008
    #4
  5. Mark Rae [MVP] wrote:
    > "Harlan Messinger" <> wrote in message
    > news:...
    >
    >> I repeat: I'm not using XHTML, I'm using HTML 4.01.

    >
    > http://www.velocityreviews.com/forums/t527477-html-401-strict-instead-of-xhtml.html


    Man, that's just awful. Well, thanks anyway. I decided to try

    <% Response.Write("<link rel=\"stylesheet\" type=\"text/css\"
    href=\"css/manager.css\">");%>

    and that does the trick. Funny, I don't get the same problem with the
    META tag.
    Harlan Messinger, Feb 19, 2008
    #5
    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. Replies:
    1
    Views:
    305
    Max Erickson
    Nov 10, 2006
  2. abcd
    Replies:
    7
    Views:
    342
    Ben Finney
    Mar 15, 2007
  3. Jeff Mitchell

    trailing slash issue in Find.find

    Jeff Mitchell, Aug 24, 2003, in forum: Ruby
    Replies:
    0
    Views:
    101
    Jeff Mitchell
    Aug 24, 2003
  4. Stan Brown
    Replies:
    6
    Views:
    365
    Stan Brown
    Oct 29, 2003
  5. Sebastian Bauer

    HTTP::Request, trailing slash

    Sebastian Bauer, Jun 29, 2004, in forum: Perl Misc
    Replies:
    9
    Views:
    172
    Sebastian Bauer
    Jul 1, 2004
Loading...

Share This Page