Disable asp menu items [Resolved]

Posted by Riyazhaider under ASP.NET on 11/5/2013 | Points: 10 | Views : 1732 | Status : [Member] | Replies : 2
I am using asp.net menu, on clicking any item it take some time to process the page and if clicks on any other link then that form is displayed, can we avoid other items click event when user clicks on an item user should not be able to click on any other item after clicking on any item.




Responses

Posted by: vishalneeraj-24503 on: 11/5/2013 [Member] [MVP] Platinum | Points: 50

Up
0
Down

Resolved
Hi you can try this
public void DisplayMenuTabs()
{
if (Session["Menu1Access"].ToString() == "True")
Menu1.Visible = true;
else
Menu1.Visible = false;
if (Session["Menu2Access"].ToString() == "True")
Menu2.Visible = true;
else
Menu2.Visible = false;
if (Session["Menu3Access"].ToString() == "True")
Menu3.Visible = true;
else
Menu3.Visible = false;
}

//Or you can find your menu as below
Menu myMenu = (Menu)Master.FindControl("menu1");
myMenu.Visible=false;

//Or you can also try

MenuItemCollection menuItems = mTopMenu.Items;
MenuItem adminItem = new MenuItem();
foreach (MenuItem menuItem in menuItems)
{
if (menuItem.Text == "Roles")
adminItem = menuItem;
}
menuItems.Remove(adminItem);

//Or do the following

MenuItem item = NavigationMenu.FindItem("Users/Manage Accounts");
item.Parent.ChildItems.Remove(item);

Riyazhaider, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 11/5/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
http://stackoverflow.com/questions/7687169/how-to-disable-a-menu-item-on-page-load-in-asp-net-4-0

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Riyazhaider, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response