472,142 Members | 1,273 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,142 software developers and data experts.

Login Redirect

Hello All:
I used a Login control to authenticate a user to login. The problem is
that when I login with good username & password, the login view would
say that the login was successful.

But for some reason the login control does not redirect the control to
DestinationPageUrl.
Even when I hardcoded to redirect to another page, it still remains in
the same page on successful login.

Does anyone know what is going wrong here?

Thanks in advance.

Oct 30 '06 #1
2 4426
Hi Brain,

Have you handled Authenticate event? You must change
AuthenticateEventArgs.Authenticated member to tell the control credentials
are valid.

protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
{
Login login = (Login) sender;

e.Authenticated =
(String.Compare(login.UserName, "brain", true) == 0) &&
(String.Compare(login.Password, "password") == 0);
}

hope this helps
--
Milosz Skalecki
MCAD
"IdleBrain" wrote:
Hello All:
I used a Login control to authenticate a user to login. The problem is
that when I login with good username & password, the login view would
say that the login was successful.

But for some reason the login control does not redirect the control to
DestinationPageUrl.
Even when I hardcoded to redirect to another page, it still remains in
the same page on successful login.

Does anyone know what is going wrong here?

Thanks in advance.

Oct 30 '06 #2
Thanks Milosz for your reply..

Unfortunately your solution didnot seem to work for me.
I am using VB script with ASP 2.0. I use the Configuration manager to
create the users and I am not exactly sure how your code would work. I
explicity set the e.Authenticated = true. But even that it didnot work.
I see that the login control is redirecting the control to the page I
wanted to go on successful login. This page is again redirecting the
control to the login page with a return url.
I am not sure if IE is doing it. (Cookies)
Thanks agian.
Hi Brain,

Have you handled Authenticate event? You must change
AuthenticateEventArgs.Authenticated member to tell the control credentials
are valid.

protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
{
Login login = (Login) sender;

e.Authenticated =
(String.Compare(login.UserName, "brain", true) == 0) &&
(String.Compare(login.Password, "password") == 0);
}

hope this helps
--
Milosz Skalecki
MCAD
"IdleBrain" wrote:
Hello All:
I used a Login control to authenticate a user to login. The problem is
that when I login with good username & password, the login view would
say that the login was successful.

But for some reason the login control does not redirect the control to
DestinationPageUrl.
Even when I hardcoded to redirect to another page, it still remains in
the same page on successful login.

Does anyone know what is going wrong here?

Thanks in advance.
Oct 30 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Simon | last post: by
11 posts views Thread by David W. Simmonds | last post: by
6 posts views Thread by BizWorld | last post: by
7 posts views Thread by Samuel Shulman | last post: by
1 post views Thread by pj | last post: by
9 posts views Thread by Josh | last post: by
10 posts views Thread by DavidPr | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.