Hello,
I have a database interface that needs to have a login authentication set up. SO for this I have a login view inside which i have the login control and i have accomplished the authentication by using membership class and role. But what i am having issue is with the returnurl. What i am trying to do is if the session expires i want the user to be directed back to the page that the user was on after he logs in. I am sure returnurl is the solution but it doesnt work for me. I am sure i am doing some thing worng. I dont even get any form of query string being passed in. Here is the code that i have in Login.aspx.cs
in the page load event.
Do i have to do something else on each pages that will pass the returnurl query string or param.
Please help.
THanks
I have a database interface that needs to have a login authentication set up. SO for this I have a login view inside which i have the login control and i have accomplished the authentication by using membership class and role. But what i am having issue is with the returnurl. What i am trying to do is if the session expires i want the user to be directed back to the page that the user was on after he logs in. I am sure returnurl is the solution but it doesnt work for me. I am sure i am doing some thing worng. I dont even get any form of query string being passed in. Here is the code that i have in Login.aspx.cs
in the page load event.
Code:
protected void Page_Load(object sender, EventArgs e)
{
string url = Request.QueryString["ReturnUrl"];
if (!String.IsNullOrEmpty(url))
{
Login mylogin = (Login) LoginView1.FindControl("Login1");
mylogin.DestinationPageUrl = url;
}
}
Do i have to do something else on each pages that will pass the returnurl query string or param.
Please help.
THanks
Comment