RE: value of attribute "ID" invalid: "_" cannot start a name

Just a big FYI here for people who might have this same problem
validating ASP.NET -generated code:

The code generated by Microsoft's ASP.NET Framework to support the
ViewState does not validate under the HTML 4.01 Transitional doctype.
Specifically, you get the following validation error about the name of
the dynamically generated element, which begins with an underscore:

	value of attribute "ID" invalid: "_" cannot start a name

However, you CAN validate it under the XHTML 1.0 Transitional doctype,
provided you make the necessary adjustments to make your pages XHTML

-----Original Message-----
From: David Dorward,,, [] On Behalf Of David
Sent: Saturday, September 16, 2006 6:02 PM
To: Phil Hadley
Subject: Re: value of attribute "ID" invalid: "_" cannot start a name

On Fri, Sep 15, 2006 at 06:50:52PM -0600, Phil Hadley wrote:
>    I'm finding a potential problem with the HTML Validator.

>    All my ASP.NET (.aspx) pages fail to validate with the following
>    error:
>                value of attribute "ID" invalid: "_" cannot start a

Which is correct ...
... so the problem is with your ASP.NET, not the validator.

>    However, I have no control over this element on the page because
>    it is dynamically generated by ASP.NET.  

Then you should take up the matter with whomever is responsible for
your ASP.NET code.

>    Surely MS wouldn't generate HTML pages that fail to validate...??


Microsoft has had a reputation for producing software that outputs
some of the worst markup on the market for some time. One of the big
selling points of one of the more recent versions of Frontpage was
that it produced valid markup ... and the advert had syntax errors in
the picture of HTML!

>    Interesting note: Even though these pages don't validate, they are
>    and searchable on Google.

There is lots of broken markup on the WWW, user agents usually come
with large amounts of error correction. Depending on error correction
is a very bad idea though (since it isn't implemented consistently or
to a standard).

David Dorward                            

Received on Tuesday, 19 September 2006 02:22:38 UTC