newbie, trouble with doctype update

Discussion in 'ASP .Net' started by Anton, Dec 7, 2009.

  1. Anton

    Anton Guest

    hi

    asp.net 3.5

    the master page of my webproject has this doctype:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    But when validating my page using w3.org, it says I have to change doctype
    to
    "XHTML 1.0 Transitional"

    Not sure what I need to change in the first doctype above, is it
    <!DOCTYPE html PUBLIC "XHTML 1.0 Transitional"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    any suggestions?
    Anton, Dec 7, 2009
    #1
    1. Advertising

  2. "Anton" <no_email> wrote in news::

    > asp.net 3.5
    >
    > the master page of my webproject has this doctype:
    > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    >
    > But when validating my page using w3.org, it says I have to change
    > doctype to
    > "XHTML 1.0 Transitional"
    >
    > Not sure what I need to change in the first doctype above, is it
    > <!DOCTYPE html PUBLIC "XHTML 1.0 Transitional"
    > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    >
    > any suggestions?


    You options:

    This should be a correct DTD declaration.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    You can verify this here:
    http://www.w3.org/TR/xhtml1/

    Scroll down to 3.1.1.

    You may want to put in the optional schema declarations in the HTML tag:

    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

    Not sure. It could also be duplicated tags in the page, although that
    would be strange.


    Peace and Grace,


    --
    Gregory A. Beamer (MVP)

    Twitter: @gbworld
    Blog: http://gregorybeamer.spaces.live.com

    *******************************************
    | Think outside the box! |
    *******************************************
    Gregory A. Beamer, Dec 7, 2009
    #2
    1. Advertising

  3. Anton

    Anton Guest

    I'm using the optinal schema decoration, but to no help :(

    I use w3.org's html validator to validate my html... when I validate by url
    I get an error saying
    Line 71, Column 412: Attribute "border" exists, but can not be used for this
    element.
    "quot;&quot;, false, false))" border="0" />"

    then the e3.org validator say this:
    "You have used the attribute named above in your document, but the document
    type you are using does not support that attribute for this element. This
    error is often caused by incorrect use of the "Strict" document type with a
    document that uses frames (e.g. you must use the "Transitional" document
    type to get the "target" attribute), or by using vendor proprietary
    extensions such as "marginheight" (this is usually fixed by using CSS to
    achieve the desired effect instead).
    This error may also result if the element itself is not supported in the
    document type you are using, as an undefined element will have no supported
    attributes; in this case, see the element-undefined error message for
    further information.

    How to fix: check the spelling and case of the element and attribute,
    (Remember XHTML is all lower-case) and/or check that they are both allowed
    in the chosen document type, and/or use CSS instead of this attribute. If
    you received this error when using the <embed> element to incorporate flash
    media in a Web page, see the "

    Strangley as it sounds is that when I validate by direct input (paste the
    html code into the form), then w3.org says my webpage has no errors, only 1
    warning.... So looks like I get one less error if I validate by direct
    input...

    strange




    "Gregory A. Beamer" <> wrote in message
    news:Xns9CDA6DED268F5gbworld@207.46.248.16...
    > "Anton" <no_email> wrote in news::
    >
    >> asp.net 3.5
    >>
    >> the master page of my webproject has this doctype:
    >> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    >> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    >>
    >> But when validating my page using w3.org, it says I have to change
    >> doctype to
    >> "XHTML 1.0 Transitional"
    >>
    >> Not sure what I need to change in the first doctype above, is it
    >> <!DOCTYPE html PUBLIC "XHTML 1.0 Transitional"
    >> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    >>
    >> any suggestions?

    >
    > You options:
    >
    > This should be a correct DTD declaration.
    >
    > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    >
    > You can verify this here:
    > http://www.w3.org/TR/xhtml1/
    >
    > Scroll down to 3.1.1.
    >
    > You may want to put in the optional schema declarations in the HTML tag:
    >
    > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    >
    > Not sure. It could also be duplicated tags in the page, although that
    > would be strange.
    >
    >
    > Peace and Grace,
    >
    >
    > --
    > Gregory A. Beamer (MVP)
    >
    > Twitter: @gbworld
    > Blog: http://gregorybeamer.spaces.live.com
    >
    > *******************************************
    > | Think outside the box! |
    > *******************************************
    Anton, Dec 7, 2009
    #3
  4. "Anton" <no_email> wrote in news:#:

    > Strangley as it sounds is that when I validate by direct input (paste
    > the html code into the form), then w3.org says my webpage has no
    > errors, only 1 warning.... So looks like I get one less error if I
    > validate by direct input...


    May be a bug with their validator. Not sure.

    Peace and Grace,

    --
    Gregory A. Beamer (MVP)

    Twitter: @gbworld
    Blog: http://gregorybeamer.spaces.live.com

    *******************************************
    | Think outside the box! |
    *******************************************
    Gregory A. Beamer, Dec 7, 2009
    #4
  5. Anton

    Anton Guest

    thanks for helping me :)

    Below is some html generated by the asp.net.

    <input type="image" name="ctl00$Login2$LoginView1$Login1$Submit"
    id="ctl00_Login2_LoginView1_Login1_Submit" src="Images/Go.gif" alt="test"
    onclick="javascript:WebForm_DoPostBackWithOptions(new
    WebForm_PostBackOptions(&quot;ctl00$Login2$LoginView1$Login1$Submit&quot;,
    &quot;&quot;, true, &quot;Login&quot;, &quot;&quot;, false, false))"
    border="0" />

    The validation error is:
    Attribute "border" exists, but can not be used for this element.
    ..quot;&quot;, false, false))" border="0" />

    The error above is related to the html I posted above. The "border=0" is
    made by asp.net. I don't know if it's possible to tell asp.net not to make
    border="0", but instead create for example a style, like
    style="border:none;"

    any suggestions?


    "Gregory A. Beamer" <> wrote in message
    news:Xns9CDA857AAB227gbworld@207.46.248.16...
    > "Anton" <no_email> wrote in news:#:
    >
    >> Strangley as it sounds is that when I validate by direct input (paste
    >> the html code into the form), then w3.org says my webpage has no
    >> errors, only 1 warning.... So looks like I get one less error if I
    >> validate by direct input...

    >
    > May be a bug with their validator. Not sure.
    >
    > Peace and Grace,
    >
    > --
    > Gregory A. Beamer (MVP)
    >
    > Twitter: @gbworld
    > Blog: http://gregorybeamer.spaces.live.com
    >
    > *******************************************
    > | Think outside the box! |
    > *******************************************
    Anton, Dec 8, 2009
    #5
  6. Anton

    Anton Guest

    I agree too that it must be a bug in the w3 validator.

    Because the html below isn't the same as generated by asp.net... That code
    below is what w3.org displays. The difference is that in the asp.net generat
    ed html there is no border=0, but style border-width:0px; instead....

    So I let this rest for a while now. I started hunting this error because I
    wanted the page to validate, and I thought rankings on google is depending
    on it


    "Anton" <no_email> wrote in message
    news:e7yzBX%...
    > thanks for helping me :)
    >
    > Below is some html generated by the asp.net.
    >
    > <input type="image" name="ctl00$Login2$LoginView1$Login1$Submit"
    > id="ctl00_Login2_LoginView1_Login1_Submit" src="Images/Go.gif" alt="test"
    > onclick="javascript:WebForm_DoPostBackWithOptions(new
    > WebForm_PostBackOptions(&quot;ctl00$Login2$LoginView1$Login1$Submit&quot;,
    > &quot;&quot;, true, &quot;Login&quot;, &quot;&quot;, false, false))"
    > border="0" />
    >
    > The validation error is:
    > Attribute "border" exists, but can not be used for this element.
    > .quot;&quot;, false, false))" border="0" />
    >
    > The error above is related to the html I posted above. The "border=0" is
    > made by asp.net. I don't know if it's possible to tell asp.net not to make
    > border="0", but instead create for example a style, like
    > style="border:none;"
    >
    > any suggestions?
    >
    >
    > "Gregory A. Beamer" <> wrote in message
    > news:Xns9CDA857AAB227gbworld@207.46.248.16...
    >> "Anton" <no_email> wrote in news:#:
    >>
    >>> Strangley as it sounds is that when I validate by direct input (paste
    >>> the html code into the form), then w3.org says my webpage has no
    >>> errors, only 1 warning.... So looks like I get one less error if I
    >>> validate by direct input...

    >>
    >> May be a bug with their validator. Not sure.
    >>
    >> Peace and Grace,
    >>
    >> --
    >> Gregory A. Beamer (MVP)
    >>
    >> Twitter: @gbworld
    >> Blog: http://gregorybeamer.spaces.live.com
    >>
    >> *******************************************
    >> | Think outside the box! |
    >> *******************************************

    >
    >
    Anton, Dec 8, 2009
    #6
  7. "Anton" <no_email> wrote in news:e7yzBX#:

    > thanks for helping me :)
    >
    > Below is some html generated by the asp.net.
    >
    > <input type="image" name="ctl00$Login2$LoginView1$Login1$Submit"
    > id="ctl00_Login2_LoginView1_Login1_Submit" src="Images/Go.gif"
    > alt="test" onclick="javascript:WebForm_DoPostBackWithOptions(new
    > WebForm_PostBackOptions(&quot;ctl00$Login2$LoginView1$Login1

    $Submit&quo
    > t;, &quot;&quot;, true, &quot;Login&quot;, &quot;&quot;, false,
    > false))" border="0" />
    >
    > The validation error is:
    > Attribute "border" exists, but can not be used for this element.
    > .quot;&quot;, false, false))" border="0" />
    >
    > The error above is related to the html I posted above. The "border=0"
    > is made by asp.net. I don't know if it's possible to tell asp.net not
    > to make border="0", but instead create for example a style, like
    > style="border:none;"
    >
    > any suggestions?



    What version of ASP.NET is this? 1.x? 2.0? 3.0? 3.5? 4.0?

    The HTML rendering gets better with each iteration of ASP.NET, so moving
    to a new version might help.

    With older versions of ASP.NET, you might be able to remove the border
    by removing the attribute from the collection. Or, check the ASPX and
    make sure you do not have a border on it. With newer versions of
    ASP.NET, you end up like this:

    <img id="Image1" src="Request_Response.png" style="border-width:0px;" />

    That solves the issue.

    Peace and Grace,



    --
    Gregory A. Beamer (MVP)

    Twitter: @gbworld
    Blog: http://gregorybeamer.spaces.live.com

    *******************************************
    | Think outside the box! |
    *******************************************
    Gregory A. Beamer, Dec 8, 2009
    #7
  8. "Anton" <no_email> wrote in news:eeSi9g#:

    > I agree too that it must be a bug in the w3 validator.
    >
    > Because the html below isn't the same as generated by asp.net... That
    > code below is what w3.org displays. The difference is that in the
    > asp.net generat ed html there is no border=0, but style
    > border-width:0px; instead....
    >
    > So I let this rest for a while now. I started hunting this error
    > because I wanted the page to validate, and I thought rankings on
    > google is depending on it
    >


    There might be something in the algorithm about proper XHTML, but the
    bigger issue is relevance of content to descriptions. If you want to
    focus on SEO, then make sure your META tags relate properly to the
    content. That is the biggest part of Google's algorithm.

    Being linked to from a trusted site also helps. But don't try the Search
    Engine Obtrusion techniques of SPAMMING blogs to get hits. Google is
    working on erradicating that.

    Peace and Grace,

    --
    Gregory A. Beamer (MVP)

    Twitter: @gbworld
    Blog: http://gregorybeamer.spaces.live.com

    *******************************************
    | Think outside the box! |
    *******************************************
    Gregory A. Beamer, Dec 8, 2009
    #8
    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. Hypo
    Replies:
    6
    Views:
    393
  2. Ian

    vs.net creates doctype wrong?

    Ian, Jun 20, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    468
  3. KS
    Replies:
    7
    Views:
    622
    Michael Winter
    Nov 10, 2004
  4. Ara.T.Howard

    [NEWBIE] extract doctype?

    Ara.T.Howard, Jun 15, 2005, in forum: Javascript
    Replies:
    2
    Views:
    92
  5. Larry Lindstrom
    Replies:
    19
    Views:
    1,268
    Jonathan N. Little
    Jun 12, 2012
Loading...

Share This Page