ASP.NET 2.0 and W3C Validation

Discussion in 'ASP.NET 2.0' started by Mike Trebilcock, Jan 13, 2006.

  1. Whilst developing a website in ASP.NET2.0 I tested it for compliance with W3C XHTML1.1 standards. Now I have hosted it the ASP.NET engine seems to be messing it up. For example the <FORM> tag now contains an 'id' and a 'name' tag although it didn't when using the ASP.NET engine supplied with Visual Web Developer.

    Does anybody have any suggestions?

    Mike Trebilcock

    http://www.primarycarelearning.net
     
  2. I found that if I validate against XHtml 1.1 then it fails but against XHtml 1.0 its fine. I have not done a massive amount of investigation since XHtml 1.0 is fine.

    Thanks for the reply
     
  3. That's odd. You are using the same .NET framework as on the web server to render the page. So the FORM tag should've also been populated with the name and id. I created a test page in Visual Web Developer with just a <form runat=server' />, and the name and id properties were automatically added.

    The ASP.NET framework creates the necessary HTML elements in order for the server control to work as intended. Some of these properties are needed, like the name/id tag on a form. I don't think you can change the way the web controls renders HTML. Alternatively, you can create your own custom controls.

    DiscountASP.NET
    www.DiscountASP.NET
     

Share This Page