ASP.NET markup

October 11th, 2004 § 3 comments

Chris Kaminski, over at the Web Standards Project blog, recently posted a rant about the poor markup generated by the ASP.NET controls. As a .NET developer myself, I share his frustration. The markup generated is truly horrible, and you can barely get it to play along with CSS and/or JavaScript.

So far, there seems to be no easy solution to the problem, although, in an update to his first post, Kaminski describes some possibilities of improvement suggested by the blog readers.

Another interesting possibility I came across in an unrelated page is adapting HTML Tidy to work with ASP.NET pages. In a blog entry on the Borland’s blogs, Steve Trefethen, a Delphi and C# Builder engineer, describes how Borland worked to integrate HTML Tidy in the Borland C# Builder IDE, and the problems they are still facing in this integration with regards to ASP.NET. Trefethen is calling people to help making HTML Tidy work with ASP.NET, something that would potentially benefit a lot of developers.

It’s a good idea, in my opinion, and it would be nice to see the community work on it. Since, as Trefethen points, HTML Tidy already supports languages like PHP and old-school ASP, supporting ASP.NET may be feasible.

There’s still another technique that can be applied to ASP.NET: run HTML as an output filter for ASP.NET pages. I didn’t try it, but since ASP.NET allows the page result to be captured, it would trivial to call HTML Tidy to clean the resulting HTML. However, considering ASP.NET’s dependency on special attributes, that would likely still require that some changes be made to HTML Tidy. But it would be potentially a better alternative to the problem since it would clean the final HTML generated by all page tags, instead of working only on the eventual HTML that may exist among ASP.NET tags.

Anyway, as long as ASP.NET generates bad markup, it will prevent the resulting page from achieving true acessibility and portability so any solution is welcome. Of course, Microsoft is also welcome to fix ASP.NET by making it generate standards-compatible markup. Somehow, I don’t see that happening soon, which makes a community-based solution even more attractive.

§ 3 Responses to ASP.NET markup"

  • Small Paul says:

    I’ve heard rumours that Microsoft will be making ASP.NET play nice with Web Standards in its 2.0 release. So you never know.

  • Small Paul says:

    Oh, and I can’t recommend highly enough. That chap is actually ploughing ahead and making ASP.NET play nice with web standards right now. Lots of really great practical tips, which is what you need if you’re working with this stuff in a production environment – and I don’t imagine many people are .NETing at home.

  • Ronaldo says:

    Hi, Paul–

    I hope Microsoft is working on the problem. That would be nice indeed. It would be our jobs much easier, and guarantee that upgrades to the platform would not break our efforts.

    About the site, I will certainly take a look at it. I also believe most people using .NET are using it only at work, and anything to help in that is interesting.

What's this?

You are currently reading ASP.NET markup at Reflective Surface.