Udostępnij za pośrednictwem


ASP.NET 4.0 -

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

Technorati Tags: asp.net,4.0,menu,semantic,tableless,css

Comments

  • Anonymous
    November 15, 2009
    Hey Now Mike, Nice Post! Thx 4 the info, Catto

  • Anonymous
    November 15, 2009
    Hi Mike, Excellent news. Is any chance for sharepoint pages renders without table markup?  

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