views:

23

answers:

1

I have a ASP.NET Login Control with Forms authentication.Even after successful Login it does not redirects to destination page.But it uses returnURL and stays at same Login page.How to make Login Control to redirect to specified destination page?

A: 

If you haven't done so already, I think you just need to set the default url in the forms tag (web.config like so)

<forms loginUrl="blablabla.aspx" defaultUrl="YourDefaultPage.aspx" />  

Give it a go and let us know how you get on.

adrianos
I also already set the default url in web.config file..but its not redirecting..i also used Login1_LoggedIn event which has a response.redirect to another page..that event is fired and all that response.redirect is also called..but fails to redirect..
Abilash
@Abilash - can you please post the code in `Login1_LoggedIn`? Might help with the solution. Based on your comment "Response.Redirect is also called..but fails to redirect" - you should be using `RedirectFromLoginPage`. This will use the ReturnUrl QS and redirect appropriately.
RPM1984
This is my code: protected void Login1_LoggedIn(object sender, EventArgs e) { if (Roles.IsUserInRole(Login1.UserName, "Admin1")) { Response.Redirect("~/Pages/UserManagement/changepassword.aspx"); }}
Abilash
is it going into the response.redirect portion of the code?
adrianos
ya it was going..
Abilash
Can you post the html for the login control (in the aspx)?
adrianos
@ RPM1984,adrainos-Now it is redirecting to the respective pages..did some changes in web.config file..Thanks friends..
Abilash