467,081 Members | 1,071 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,081 developers. It's quick & easy.

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
  • viewed: 4272
Share:
2 Replies
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
By using this site, you agree to our Privacy Policy and Terms of Use.