0
사용자가 로그온하지 않은 경우 MasterView에 LoginView가 있고 응용 프로그램이 LoginControl.ascx를 표시합니다. 이 LoginControl.ascx에서 나는 인증을합니다. 문제는 응용 프로그램이 사용자를 인증 할 때 LoginView가 익명 템플릿에서 템플릿을 인증하기 위해 변경되지 않는다는 것입니다.LoginView 및 사용자 지정 ASP.NET WF
protected void btnLogin_clicked(object sender, EventArgs e)
{
// check username and password
if (PlatneJmeno(txtUsernane.Text) && PlatneHeslo(txtPassword.Text))
{
if (Membership.ValidateUser(txtUsernane.Text, txtPassword.Text))
{
//FormsAuthentication.RedirectFromLoginPage(txtUsernane.Text, false);
Response.Redirect(Request.RawUrl);
}
else
{
Session["LoginError"] = true;
Session["LoginFromPage"] = Request.RawUrl;
Response.Redirect("login.aspx");
}
}
else
{
Session["LoginError"] = true;
Session["LoginFromPage"] = Request.RawUrl;
Response.Redirect("login.aspx");
}
}
수행, 확인 ...
FormsAuthentication.SetAuthCookie(txtUsernane.Text, false);