Articles → .NET → Giving identity to each page in ASP.NET 2.0

Giving identity to each page in ASP.NET 2.0





















public enum MenuType
{
Admin,
NonAdmin
}






private MenuType _MenuObject;
public MenuType MenuObject
{
  get{return _MenuObject;}
  set
  {
    _MenuObject = value;
  }
}




if (!IsPostBack)
{
 ((MasterPage)Page.Master).MenuObject = MasterPage.MenuType.NonAdmin;
}




if (!IsPostBack)
{
((MasterPage)Page.Master).MenuObject = MasterPage.MenuType.Admin;
}




if (_MenuObject == MenuType.Admin)
{
// Create a menu for Admin
}
 else if (_MenuObject == MenuType.NonAdmin)
{
 	// Create a menu for Non Admin
}







Posted By  -  Karan Gupta
 
Posted On  -  Thursday, December 23, 2010

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250