title: ASP.net How make an element on the Navigation Bar disappear through calling an if statement?
body: <p>I'm trying to call an action after an if statement where the element on the navigation bar disappears. </p>
  
  <p>So for example, I want the element that says "Upload File" disappeared after I start after calling the first part of the if statement</p>
  
  <p>Note: I'm calling the if statement in the _Layout.cshtml where the element was created. I would like to know if this is the correct place where I'm calling it.</p>
  
  <p><strong>If statement</strong></p>
  
  <pre><code>@if (User.IsInRole("Member"))
  {
  
  }
  </code></pre>
  
  <p><strong>Element</strong></p>
  
  <pre><code>&lt;div class="navbar-collapse collapse"&gt;
                  &lt;ul class="nav navbar-nav"&gt;
                      &lt;li&gt;@Html.ActionLink("Upload File", "UploadFile", "Home")&lt;/li&gt;
  </code></pre>
  
  <p>"Member" in the if statement is coming from the <code>ASPNetRoles</code> in the local database which works perfectly fine.</p>