fordie’s Blog

25 Oct, 2007

Quick tip for using XHTML Strict with ASP.net

Posted by: admin In: .net|annoyances|web development|xhtml

One thing that has always infuriated me with .net is it’s insistence on adding an invalid name attribute to the asp.net form*.

About a month ago I found a nice easy cure for this, so I thought I’d share it. All you need to do to stop .net adding the name attribute to the form is add an xhtmlConformance tag to your web.config like so:

<configuration>
<system.web>
<xhtmlConformance mode="Strict" />
</system.web>
</configuration>

Hopefully that’ll be of some use to someone.

*What annoys me more is the fact you have to have a form tag on every page for .net to work, but that’s a rant for another day.

1 Response to "Quick tip for using XHTML Strict with ASP.net"

1 | Mark

September 6th, 2008 at 6:47 pm

Avatar

Well, what do you know? Almost a year after I posted this and we’re finally in a position where we can think about ditching the bloody forms from our .net applications with the .net MVC framework.

Scott Guthrie’s blog (weblogs.asp.net/scottgu) is a good place to start looking for more info

Comment Form

fordie, elsewhere:

if you're an internet stalker these would be good sites for you to stalk me on…