I’m looking to create a very simple Logout page but falling at the first hurdle.
Here’s my current Login page if it helps:
http://pastebin.com/2xJH1DnT
protected void Page_Load(object sender, EventArgs e)
{
RegisterHyperLink.NavigateUrl = "Register.aspx?ReturnUrl=" +
HttpUtility.UrlEncode(Request.QueryString["ReturnUrl"]);
}
I tried initially using FormsAuthentication.SignOut(); in my logout CodeBehind but kept getting the error:
CS0103: The name ‘FormsAuthentication’ does not exist in the current context
How can I implement a log-out feature?
which errors did you get? The right way should be:
this applied if you are using Forms Authentication of course.