Welcome to MSDN Blogs Sign in | Join | Help

Mike Ormond's Blog

In my world, things would be simpler than this...

News

  • Add to Technorati Favorites

    These postings are provided "AS IS" with no warranties, and confer no rights. The use of any script / code samples is subject to the terms specified here.

ASP.NET 4.0 - <asp:Menu> and semantic markup

By default, the menu control in ASP.NET 4.0 now renders tableless markup. Here’s the default ASP.NET Web Forms template (see my previous post) which uses an <asp:Menu> control for navigation.

Below you should be able to see it highlighted on the page (outlined in blue) and the corresponding markup in the IE8 Developer Tools window. You can see the <asp:Menu> renders as a <div> containing a <ul> of menu items rendered as <li> elements. This gives you scope to style it any way you choose.

(of course it is still possible to reinstate the old <asp:Menu> behaviour for backward compatibility).

menu

Posted: Friday, November 13, 2009 6:04 PM by MikeOrmond

Comments

ccatto said:

Hey Now Mike,

Nice Post!

Thx 4 the info,

Catto

# November 16, 2009 6:49 AM

Aj said:

Hi Mike,

Excellent news. Is any chance for sharepoint pages renders without table markup?  

# November 16, 2009 7:33 AM

MikeOrmond said:

Hi Aj. Not sure TBH, haven't had a chance to look at SharePoint 2010 as yet. Mike

# November 24, 2009 9:29 AM
Leave a Comment

(required) 

(required) 

(optional)

(required) 

  
Enter Code Here: Required

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Page view tracker