title: Hiding or showing menu item in asp.net based on whether user is logged in or not
body: <p>I need to make a change to a website's menu system which is written in asp.net and vb.net.  I would like to hide the menu item (Value="ProdinTran") from being seen when a user is not logged into the site.  Can you show me what I need to add to this code to do this?</p>
  
  <p>Here is the current code:</p>
  
  <pre><code>&lt;%@ Master Language="VB" AutoEventWireup="false" CodeFile="Site.Master.vb" Inherits="Site" %&gt;
  
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"&gt;
  &lt;head runat="server"&gt;
      &lt;title&gt;&lt;/title&gt;
      &lt;link href="~/Styles/Site.css" rel="stylesheet" type="text/css" /&gt;
      &lt;asp:ContentPlaceHolder ID="HeadContent" runat="server"&gt;
      &lt;/asp:ContentPlaceHolder&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form runat="server"&gt;
      &lt;div class="page"&gt;
          &lt;div class="header"&gt;
              &lt;div class="title"&gt;
                  &lt;h1&gt;
                       Portal
                  &lt;/h1&gt;
              &lt;/div&gt;
              &lt;div class="loginDisplay"&gt;
                  &lt;asp:LoginView ID="HeadLoginView" runat="server" EnableViewState="false"&gt;
                      &lt;AnonymousTemplate&gt;
                          [ &lt;a href="~/Account/Login.aspx" ID="HeadLoginStatus" runat="server"&gt;Log In&lt;/a&gt; ]
                      &lt;/AnonymousTemplate&gt;
                      &lt;LoggedInTemplate&gt;
                          Welcome &lt;span class="bold"&gt;&lt;asp:LoginName ID="HeadLoginName" runat="server" /&gt;&amp;nbsp;&lt;/span&gt;!&amp;nbsp; 
                          [ &lt;asp:LoginStatus ID="HeadLoginStatus" runat="server" LogoutAction="Redirect" LogoutText="Log Out" LogoutPageUrl="~/"/&gt; ]
                      &lt;/LoggedInTemplate&gt;
                  &lt;/asp:LoginView&gt;
              &lt;/div&gt;
              &lt;div class="clear hideSkiplink"&gt;
                  &lt;asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" EnableViewState="false" IncludeStyleBlock="false" Orientation="Horizontal" DisappearAfter="1000"&gt;
                      &lt;Items&gt;
                          &lt;asp:MenuItem NavigateUrl="~/Default.aspx" Text="Home"&gt;
                              &lt;asp:MenuItem NavigateUrl="~/Default.aspx" Text="Portal Home Page" 
                                  Value="Portal Home Page"&gt;&lt;/asp:MenuItem&gt;
                              &lt;asp:MenuItem NavigateUrl="http://www.something.com/index.php?option=com_content&amp;view=article&amp;id=212&amp;Itemid=28" Text="About" 
                                  Value="About" Target="_parent"&gt;&lt;/asp:MenuItem&gt;
                              &lt;asp:MenuItem NavigateUrl="http://www.something.com" 
                                  Text="Web Site" 
                                  ToolTip="Home Page" Value="Home" Target="_parent"&gt;
                              &lt;/asp:MenuItem&gt;
                          &lt;/asp:MenuItem&gt;
                         &lt;asp:MenuItem Text="Customer" Value="Customer" 
                              ToolTip="Registered customers" NavigateUrl="~/Customer.aspx?mySelect=0"&gt;
                               &lt;asp:MenuItem NavigateUrl="~/Customer.aspx?mySelect=0"
                                  Text="Customer Home Page" Value="Chp"&gt;
                               &lt;/asp:MenuItem&gt;
                               &lt;asp:MenuItem NavigateUrl="~/Customer.aspx?mySelect=2" 
                                  Text="Open Orders" 
                                  ToolTip="View your open orders" Value="OpenOrders"&gt;
                              &lt;/asp:MenuItem&gt;
                                &lt;asp:MenuItem NavigateUrl="~/Customer.aspx?mySelect=3" 
                                  Text="Canceled Orders" 
                                  ToolTip="View your canceled orders" Value="Canceled"&gt;
                              &lt;/asp:MenuItem&gt;
                              &lt;asp:MenuItem NavigateUrl="~/Customer.aspx?mySelect=4" 
                                  Text="Shipped Orders" 
                                  ToolTip="View your shipped orders" Value="Shipped"&gt;
                              &lt;/asp:MenuItem&gt;
                              &lt;asp:MenuItem Text="Product in Transit" ToolTip="Product in Transit" Value="ProdinTran" NavigateUrl="http://www.google.com"&gt;
                              &lt;/asp:MenuItem&gt;
                              &lt;asp:MenuItem NavigateUrl="~/Customer.aspx?mySelect=5" 
                                  Text="Invoices" 
                                  ToolTip="View your invoices" Value="Invoices"&gt;
                              &lt;/asp:MenuItem&gt;
                              &lt;asp:MenuItem NavigateUrl="~/Customer.aspx?mySelect=6" 
                                  Text="Credit Memos" 
                                  ToolTip="View your credit memos" Value="Credits"&gt;
                              &lt;/asp:MenuItem&gt;
                                  &lt;asp:MenuItem NavigateUrl="~/Account/ChangePassword.aspx" 
                                  Text="Change Password" ToolTip="Change your password." 
                                  Value="Change"&gt;
                              &lt;/asp:MenuItem&gt;
                        &lt;/asp:MenuItem&gt;
                          &lt;asp:MenuItem Text="Help &amp;amp; Information" 
                              ToolTip="Holidays, Shipping, Passwords" Value="Help"&gt;
                               &lt;asp:MenuItem Text="Terms &amp;amp; Conditions" 
                                  ToolTip="View Terms &amp;amp; Conditions" 
                                  Value="Terms" NavigateUrl="http://www.something.com/terms.html" 
                                   Target="_parent"&gt;
                                  &lt;/asp:MenuItem&gt;
                             &lt;asp:MenuItem Text="Holiday Schedule" 
                                  ToolTip="View Holiday Schedule" 
                                  Value="Holiday" NavigateUrl="~/Holiday.aspx"&gt;&lt;/asp:MenuItem&gt;
                              &lt;asp:MenuItem Text="Shipping Company Information" 
                                  ToolTip="View information on shipping companies" 
                                  Value="Shipping" NavigateUrl="~/Shipping.aspx"&gt;&lt;/asp:MenuItem&gt;
                              &lt;asp:MenuItem NavigateUrl="~/Forgot.aspx" Text="Reset My Password" 
                                  ToolTip="Reset your password." Value="Reset"&gt;
                              &lt;/asp:MenuItem&gt;
                              &lt;asp:MenuItem NavigateUrl="~/HowDoI.aspx" Text="How Do I Access my info?" 
                                  ToolTip="See how to register, logon, reset your password, change your password and access your account." Value="Retrieve"&gt;
                              &lt;/asp:MenuItem&gt;
                              &lt;asp:MenuItem Text="Register                " 
                                  ToolTip="Click here to register on this site" 
                                  Value="Register2" NavigateUrl="~/Account/Register.aspx"&gt;&lt;/asp:MenuItem&gt;
                          &lt;/asp:MenuItem&gt;
              &lt;asp:MenuItem NavigateUrl="~/Remnant1.aspx" Text="Remnants" 
                                  Value="Remnants"&gt;&lt;/asp:MenuItem&gt;
                      &lt;/Items&gt;
                  &lt;/asp:Menu&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="main"&gt;
              &lt;asp:ContentPlaceHolder ID="MainContent" runat="server"/&gt;
          &lt;/div&gt;
          &lt;div class="clear"&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="footer"&gt;
   &amp;copy;&amp;nbsp;2014 - All Rights Reserved&lt;br /&gt;
      &lt;/div&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Thank you in advance for your help!</p>