title: How to disable specific menu item from menu control in asp.net C# code behind
body: <p>In Master Page: </p>
  
  <pre><code> &lt;asp:Menu ID="Menu1" runat="server" Orientation="Horizontal" Width="60%" 
              BackColor="#336699" Font-Bold="True" 
              ForeColor="White"&gt;
              &lt;StaticMenuStyle BackColor="#336699" /&gt;
              &lt;StaticSelectedStyle BackColor="#336699" /&gt;
              &lt;StaticMenuItemStyle BackColor="#336699" /&gt;
              &lt;DynamicHoverStyle BackColor="#336699" /&gt;
              &lt;DynamicMenuStyle BackColor="#336699" /&gt;
              &lt;DynamicMenuItemStyle BackColor="#336699" /&gt;
              &lt;StaticHoverStyle BackColor="#336699" /&gt;
          &lt;Items&gt;
              &lt;asp:MenuItem Text="Dashboard" NavigateUrl="~/Timecard/Dashboard.aspx"&gt;
              &lt;/asp:MenuItem&gt;
                              &lt;asp:MenuItem Text="Timecard" NavigateUrl="~/Timecard/TimeCardEntry.aspx"&gt;
              &lt;/asp:MenuItem&gt;
                              &lt;asp:MenuItem Text="Reports"&gt;
                              &lt;asp:MenuItem Text="Employee Time card Report" NavigateUrl="~/Reports/Employee_Timecard .aspx"&gt;&lt;/asp:MenuItem&gt;
                              &lt;asp:MenuItem Text="Employee Leave Detail Report" NavigateUrl="~/Reports/Employee Leave Details.aspx"&gt;&lt;/asp:MenuItem&gt;
                              &lt;asp:MenuItem Text="Project wise Report" NavigateUrl="~/Reports/ProjectWise.aspx"&gt;&lt;/asp:MenuItem&gt;
              &lt;/asp:MenuItem&gt;
                              &lt;asp:MenuItem Text="Master"&gt;
                                  &lt;asp:MenuItem Text="Company" NavigateUrl="~/Admin/CompanyList.aspx"&gt;&lt;/asp:MenuItem&gt;
                                  &lt;asp:MenuItem Text="Designation" NavigateUrl="~/Admin/DesignationList.aspx"&gt;&lt;/asp:MenuItem&gt;
                                  &lt;asp:MenuItem Text="Task" NavigateUrl="~/Admin/TaskList.aspx"&gt;&lt;/asp:MenuItem&gt;
                                  &lt;asp:MenuItem Text="Project" NavigateUrl="~/Admin/ProjectList.aspx"&gt;&lt;/asp:MenuItem&gt;
                                  &lt;asp:MenuItem Text="Employee" NavigateUrl="~/Admin/EmployeeList.aspx"&gt;&lt;/asp:MenuItem&gt;
                                  &lt;asp:MenuItem Text="Employee Transfer/Promotion" NavigateUrl="~/Admin/EmployeeTransferList.aspx"&gt;&lt;/asp:MenuItem&gt;
                              &lt;asp:MenuItem Text="Holiday" NavigateUrl="~/Admin/HolidayList.aspx"&gt;&lt;/asp:MenuItem&gt;
              &lt;/asp:MenuItem&gt;
          &lt;/Items&gt;
          &lt;/asp:Menu&gt;
  </code></pre>
  
  <p>I want to disable Reports and Master menus in codebehind. I have to check that it was admin or not. if user is in status admin means all menu items should display, if user is not an admin means i have to set visible=false for report and master menu. Please help me.</p>