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).


Technorati Tags:,4.0,menu,semantic,tableless,css