In web.Config you need to change some values.
<authentication mode="Forms">
<forms loginurl="Login.aspx" defaulturl="Home.aspx" path="/">
</forms></authentication>
<authorization>
<deny users="?" />
</authorization>
In Login.aspx.cs Page you need to authenticate the user by cookies
if (IsAuth)
{
FormsAuthenticationTicket authTicket = new
FormsAuthenticationTicket(1,
txtUserId.Value,
DateTime.Now,
DateTime.Now.AddMinutes(1),
false,
userData,
FormsAuthentication.FormsCookiePath);
string encryptedTicket = FormsAuthentication.Encrypt(authTicket);
HttpCookie authCookie =
new HttpCookie(FormsAuthentication.FormsCookieName,encryptedTicket);
Response.Cookies.Add(authCookie);
Response.Redirect(FormsAuthentication.GetRedirectUrl(txtUserId.Value, true));
}