title: Check for authentication from View ASP.Net
body: <p>I want to generate the login link or profile link in a view, depending on user authentication state, but nothing happens, and I get an empty place like this: <code>&lt;div&gt; &lt;/div&gt;</code></p>
  
  <pre><code>&lt;div&gt;
       @if (User.Identity.IsAuthenticated)
       {
            Html.ActionLink(GlobalRes.BlogEditProfile, "Edit", "Profile");
       }
       @if (!User.Identity.IsAuthenticated)
       {
            Html.ActionLink(GlobalRes.Login, "Login", "Account");
       }
  &lt;/div&gt;
  </code></pre>
  
  <p>Please tell me where my mistake is?</p>