ASP.NET 4.0- Menu control enhancement.
Till asp.net 3.5 asp.net menu control was rendered through table. And we all know that it is very hard to have CSS applied to table. For a professional look of our website a CSS is must required thing. But in asp.net 4.0 Menu control is table less it will loaded with UL and LI tags which is easier to manage through CSS. Another problem with table is it will create a large html which will increase your asp.net page KB and decrease your performance. While with UL and LI Tags its very easy very short. So You page KB Size will also be down.
Let’s take a simple example. Let’s Create a menu control in asp.net with four menu item like following.
<asp:Menu ID="myCustomMenu" runat="server" >It will render menu in browser like following.
<asp:MenuItem Text="Menu1" Value="Menu1"></asp:MenuItem>
<asp:MenuItem Text="Menu2" Value="Menu2"></asp:MenuItem>
<asp:MenuItem Text="Menu3" Value="Menu3"></asp:MenuItem>
<asp:MenuItem Text="Menu4" Value="Menu4"></asp:MenuItem>
That’s it..Stay tuned for more..Happy programming..Technorati Tags: Menu,Asp.NET 4.0CodeProject