M
Mr.KisS
Hi,
I'm working with ASP.NET 2 (VWD). I have a Login page and a
folder to protect. I have a Database which contains
usernames & passwords.
The problem is that when i go to the protected folder it
automatically redirects me to the LOgin page with the rfeer
url. And when i login with false informations, its show me
the error panel. BUT, when i enter good informations, it
reloads the Login page as i've just arrived instead of
redirect me with authed cookie to the protected folder...
Any ideas? (sources codes after =>)
In my web.config i have this code to protect the fodler :
____
<system.web>
<authentication mode= "Forms">
<forms name=".WIZOUAUTH" loginUrl="Login.aspx"/>
</authentication>
</system.web>
<location path="members/">
<system.web>
<authorization>
<deny users="*" />
</authorization>
</system.web>
</location>
____
Login.aspx :
(IsGoodUser is works fine, it's the func which return if
the user exists and the password is good or not).
____
void btnLogin_Click(object sender, EventArgs e)
{
if (IsGoodUser(boxLogin.Text, boxPwd.Text) == true)
{
FormsAuthentication.RedirectFromLoginPage(boxLogin.Text, true);
}
else
{
pnlLogin.Visible = false;
pnlLogin.Enabled = false;
pnlError.Visible = true;
pnlError.Enabled = true;
}
}
____
Regards.
I'm working with ASP.NET 2 (VWD). I have a Login page and a
folder to protect. I have a Database which contains
usernames & passwords.
The problem is that when i go to the protected folder it
automatically redirects me to the LOgin page with the rfeer
url. And when i login with false informations, its show me
the error panel. BUT, when i enter good informations, it
reloads the Login page as i've just arrived instead of
redirect me with authed cookie to the protected folder...
Any ideas? (sources codes after =>)
In my web.config i have this code to protect the fodler :
____
<system.web>
<authentication mode= "Forms">
<forms name=".WIZOUAUTH" loginUrl="Login.aspx"/>
</authentication>
</system.web>
<location path="members/">
<system.web>
<authorization>
<deny users="*" />
</authorization>
</system.web>
</location>
____
Login.aspx :
(IsGoodUser is works fine, it's the func which return if
the user exists and the password is good or not).
____
void btnLogin_Click(object sender, EventArgs e)
{
if (IsGoodUser(boxLogin.Text, boxPwd.Text) == true)
{
FormsAuthentication.RedirectFromLoginPage(boxLogin.Text, true);
}
else
{
pnlLogin.Visible = false;
pnlLogin.Enabled = false;
pnlError.Visible = true;
pnlError.Enabled = true;
}
}
____
Regards.