Skip to main content

Posts

Showing posts from December, 2011

Hierarchical MenuItem in ASP.NET

In all websites we have menus of some type or other. Here we will talk about creating a hierarchical menu using ASP.NET MenuItem. Add a MenuItem control to the page as shown below < form id ="frmMain" runat ="server">     < div >         < asp : Menu ID ="menuHotels" runat ="server"             onmenuitemclick ="menuHotels_MenuItemClick">                     </ asp : Menu >     </ div > </ form > Code in code behind page:  As this is a sample application please ignore hard coding of connectionstring and naming convention. using System; using System.Collections.Generic; using System.Data.SqlClient; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; namespace Hotels {     public partial class HotelWorld : System.Web.UI. Page     {         protected void Page_Load(