Check out this page here:
http://msdn.microsoft.com/en-us/library/xdt4thhy(v=vs.100).aspx
Here is the basics to set up Forms Authentication:
web.config:
<system.web>
<authentication mode="Forms">
<forms loginUrl="logon.aspx" name=".ASPXFORMSAUTH">
</forms>
</authentication>
<authorization>
<deny users="?" />
</authorization>
</system.web>
Logon page:
<script runat="server">
void Logon_Click(object sender, EventArgs e)
{
if ((UserEmail.Text == "jchen@contoso.com") &&
(UserPass.Text == "37Yj*99Ps"))
{
FormsAuthentication.RedirectFromLoginPage
(UserEmail.Text, Persist.Checked);
}
else
{
Msg.Text = "Invalid credentials. Please try again.";
}
}
</script>
Signout page:
<script runat="server">
void Page_Load(object sender, EventArgs e)
{
Welcome.Text = "Hello, " + Context.User.Identity.Name;
}
void Signout_Click(object sender, EventArgs e)
{
FormsAuthentication.SignOut();
Response.Redirect("Logon.aspx");
}
</script>