J
James Thomas
I have an issue with the login process on my site since the upgrade to
ASP .NET 2.0 (from 1.1).
I have the standard textbox and button for logging and my own custom
login process. I'd like to continue using this as it works fine
(usually) and meets my needs exactly.
Anyway, When a user logs in successfully, everything is fine. When an
invalid user name and password is entered, I inform the user of this
using a javascript alert(). This also works fine. However, on the VERY
NEXT click .
Alert is a simple function that sends a javascript alert using
ClientScript.RegisterStartupScript() to display an alert on the client.
I am fairly certain that the problem isn't with the login code as the
alert is being sent correctly to the client.
The only way to get this working is to cause a redirect to happen,
redirecting the page to itself.
Any ideas?
Thanks,
James
Here's my code:
protected void btnLogin_Click(object sender, EventArgs e)
{
Succeed.Login login = new X.Login(txtLogin.Text, txtPassword.Text);
string redirect = "";
switch (login.go())
{
case X.Login.Status.Admin:
redirect = "xxx.aspx";
break;
case X.Login.Status.Expired:
Alert("Login expired. Please call xxx-xxx-xxxx to renew.");
return;
case X.Login.Status.GroupOwner:
redirect = "xxxx.aspx";
break;
case X.Login.Status.Invalid: // ** HERE **
Alert("Invalid login or password. Please try again.");
return;
default: // Success!
redirect = "xxx_Main.aspx";
break;
}
if (redirect.Length > 0)
{
if (State.Check("SSO") == false)
{
string script = "SetCloseParent(true); PopupSize('" + redirect +
"','xxx'," // URL
+ "'800px','600px');";
Script(script);
}
else
UI.Goto(redirect);
}
}
ASP .NET 2.0 (from 1.1).
I have the standard textbox and button for logging and my own custom
login process. I'd like to continue using this as it works fine
(usually) and meets my needs exactly.
Anyway, When a user logs in successfully, everything is fine. When an
invalid user name and password is entered, I inform the user of this
using a javascript alert(). This also works fine. However, on the VERY
NEXT click .
Alert is a simple function that sends a javascript alert using
ClientScript.RegisterStartupScript() to display an alert on the client.
I am fairly certain that the problem isn't with the login code as the
alert is being sent correctly to the client.
The only way to get this working is to cause a redirect to happen,
redirecting the page to itself.
Any ideas?
Thanks,
James
Here's my code:
protected void btnLogin_Click(object sender, EventArgs e)
{
Succeed.Login login = new X.Login(txtLogin.Text, txtPassword.Text);
string redirect = "";
switch (login.go())
{
case X.Login.Status.Admin:
redirect = "xxx.aspx";
break;
case X.Login.Status.Expired:
Alert("Login expired. Please call xxx-xxx-xxxx to renew.");
return;
case X.Login.Status.GroupOwner:
redirect = "xxxx.aspx";
break;
case X.Login.Status.Invalid: // ** HERE **
Alert("Invalid login or password. Please try again.");
return;
default: // Success!
redirect = "xxx_Main.aspx";
break;
}
if (redirect.Length > 0)
{
if (State.Check("SSO") == false)
{
string script = "SetCloseParent(true); PopupSize('" + redirect +
"','xxx'," // URL
+ "'800px','600px');";
Script(script);
}
else
UI.Goto(redirect);
}
}