Re: Question regarding W3C validator and ASP.NET

<quote who="Matt Salmon">

> Basically, ASP.NET 2.0 can enhance the way pages are rendered in order
> to conform with xhtml 1.0 strict, using a configuration setting. This
> has the effect of removing the 'name' attribute from the form element,
> wrapping the hidden asp.net fields in a 'div' element and some other
> changes.

Only Microsoft would describe a bug fix as an "enhancement".

> The issue with the hidden fields is that the ID's start with an
> underscore character e.g "__VIEWSTATE",

Correct

> however what I can't understand
> is how wrapping the fields in an outer 'div' results in a 'pass' from
> the validation service?

The child element of a form must be an element in the group %block (other
than form). Inputs are not in that group, div elements are. Div elements
are allowed to contain inputs.

Starting an id with an underscore is a seperate issue. The setting may or
may not fix that.

Note that a control _name_ MAY start with an underscore, and there is
usually no reason to give a hidden input an id, so it is possible you are
just confusing names and ids here.

Seeing the difference in the code outputted in the two modes might help us
shed more light on the matter.

(Please direct responses to the www-validator mailing list and not
directly to me).

-- 
David Dorward
http://dorward.me.uk/

Received on Tuesday, 2 June 2009 08:56:29 UTC