asp.net web service login
<p>I have a login system using forms authentication, the problem is I want login and register links if the user is not logged in and if the user is logged in I want welcome username and a logout link. My website is using master page for a consistent layout so I am assuming all the code will go in there..</p>

<p>I am thinking on the page load I will have something like this:</p>

<pre><code>if (User.Identity.IsAuthenticated)
    {
        label1.Text = User.Identity.Name;
    }
</code></pre>

<p>But I get user does not exist in the current context.</p>

<p>Thanks</p>
