Rick van den Bosch - Blog

... on .NET, software architecture, software development and whatnot

Recent Posts

Tags

News

Community

Email Notifications

Blogs I read

Interesting links

Archives

ASP.Net 2.0 menu rendering differently in browser and at w3.org validator

I ran in to something strange today...

The ASP.Net 2.0 Menu control renders differently in a browser and in the W3 validator. Loading the page in a browser results in the usage of the correct attribute 'vertical-align' for the image which is used to indicate a menu has subitems. I checked this in IE and FireFox and both browsers rendered correct XHTML. When you copy the source of the rendered page and paste it in the validator-textbox at W3.org, it validates the XHTML. When you check the page directly by entering a URL, the menu renders using the non-correct attribute 'valign', causing my page to fail validation.  But the copied source passes validation!

I'll investigate this strange behaviour and get back at you when I find something. If you know where this is comming from: drop me a line in the comments.

Comments

Nathan Pledger said:

I've already expressed my distaste for all these supposed "accessibility friendly" controls that have been introduced. It does increase reliance on stock controls and less on the abilities of the programmer - resulting in a degree of false faith.

My approach: do it yourself, but use the XHTML output of ASP.NET 2.0 to ensure a strong control.
# November 24, 2005 11:08 PM

Erwyn van der Meer said:

Rick, check out this blog post: http://idunno.org/displayBlog.aspx/2005080101. The root cause is that the ASP.NET 2.0 browser sniffing (in the default configuration) doesn't recognize the W3C Validator. It is then treated as a down-level browser. The post links to a w3cvalidator.browser file that you can use to remedy this.
# November 25, 2005 3:53 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)