i want code to remove submenu
-
i am working in designing website using C# in visual studio 2010... all my pages comes under one page which is a master page .The master page contain menu which will appear in all other pages.... my request is : 1- when the user of the system will login for example as admin then all menu will appear for him while the the rest users will be able to see all the menu with all submenu except the menu that list admin rule activity which will be appear if they login only as admin.... i try to use the following code but it show error on( NavigationMenu) please provide me with the write code if possible
void Page_Load(Object sender, EventArgs e)
{
if (!IsPostBack)
{
// Retrieve the root menu item from the Items
// collection of the Menu control.
MenuItem homeMenuItem = NavigationMenu.Items[0];// Retrieve the Movie submenu item from the ChildItems // collection of the root menu item. MenuItem movieSubMenuItem = NavigationMenu.FindItem(@"Home\\Movies"); // Remove the Movie submenu item. if (movieSubMenuItem != null) { homeMenuItem.ChildItems.Remove(movieSubMenuItem); } }
}
-
i am working in designing website using C# in visual studio 2010... all my pages comes under one page which is a master page .The master page contain menu which will appear in all other pages.... my request is : 1- when the user of the system will login for example as admin then all menu will appear for him while the the rest users will be able to see all the menu with all submenu except the menu that list admin rule activity which will be appear if they login only as admin.... i try to use the following code but it show error on( NavigationMenu) please provide me with the write code if possible
void Page_Load(Object sender, EventArgs e)
{
if (!IsPostBack)
{
// Retrieve the root menu item from the Items
// collection of the Menu control.
MenuItem homeMenuItem = NavigationMenu.Items[0];// Retrieve the Movie submenu item from the ChildItems // collection of the root menu item. MenuItem movieSubMenuItem = NavigationMenu.FindItem(@"Home\\Movies"); // Remove the Movie submenu item. if (movieSubMenuItem != null) { homeMenuItem.ChildItems.Remove(movieSubMenuItem); } }
}
-
i am working in designing website using C# in visual studio 2010... all my pages comes under one page which is a master page .The master page contain menu which will appear in all other pages.... my request is : 1- when the user of the system will login for example as admin then all menu will appear for him while the the rest users will be able to see all the menu with all submenu except the menu that list admin rule activity which will be appear if they login only as admin.... i try to use the following code but it show error on( NavigationMenu) please provide me with the write code if possible
void Page_Load(Object sender, EventArgs e)
{
if (!IsPostBack)
{
// Retrieve the root menu item from the Items
// collection of the Menu control.
MenuItem homeMenuItem = NavigationMenu.Items[0];// Retrieve the Movie submenu item from the ChildItems // collection of the root menu item. MenuItem movieSubMenuItem = NavigationMenu.FindItem(@"Home\\Movies"); // Remove the Movie submenu item. if (movieSubMenuItem != null) { homeMenuItem.ChildItems.Remove(movieSubMenuItem); } }
}
don't shout... Remove bold font. it looks very rude.
Thanks -Amit Gajjar (MinterProject)
-
don't shout... Remove bold font. it looks very rude.
Thanks -Amit Gajjar (MinterProject)
@AmitGajjar wrote:
don't shout... Remove bold font. it looks very rude.
This is a helpful response. I thought all USING ALL CAPS is considered "shouting". Now its bold text too? I find your mis-usage of punctuation and incomplete sentences rude.
-
@AmitGajjar wrote:
don't shout... Remove bold font. it looks very rude.
This is a helpful response. I thought all USING ALL CAPS is considered "shouting". Now its bold text too? I find your mis-usage of punctuation and incomplete sentences rude.
Yeah Just imagine what THIS IS THEN :)
-
Yeah Just imagine what THIS IS THEN :)
That must be a top of the lungs scream! haha
-
That must be a top of the lungs scream! haha
:laugh:
Thanks -Amit Gajjar (MinterProject)
-
i am working in designing website using C# in visual studio 2010... all my pages comes under one page which is a master page .The master page contain menu which will appear in all other pages.... my request is : 1- when the user of the system will login for example as admin then all menu will appear for him while the the rest users will be able to see all the menu with all submenu except the menu that list admin rule activity which will be appear if they login only as admin.... i try to use the following code but it show error on( NavigationMenu) please provide me with the write code if possible
void Page_Load(Object sender, EventArgs e)
{
if (!IsPostBack)
{
// Retrieve the root menu item from the Items
// collection of the Menu control.
MenuItem homeMenuItem = NavigationMenu.Items[0];// Retrieve the Movie submenu item from the ChildItems // collection of the root menu item. MenuItem movieSubMenuItem = NavigationMenu.FindItem(@"Home\\Movies"); // Remove the Movie submenu item. if (movieSubMenuItem != null) { homeMenuItem.ChildItems.Remove(movieSubMenuItem); } }
}