newbie, trouble with doctype update

  • Thread starter Thread starter Anton
  • Start date Start date
A

Anton

Anton said:
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! |
*******************************************
 
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
 
Anton said:
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! |
*******************************************
 
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?
 
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 said:
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! |
*******************************************
 
Anton said:
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! |
*******************************************
 
Back
Top