Hi hbeckham,
You can use cookies. Add the ReturnUrl in the cookies and redirect to the login page. The in the login cleck event validate the Login. After successful login get the ReturnUrl from the Cookies and redirect to the requested page.
In the code where you redirect to the login page:
Response.Cookies.Add(new HttpCookie("ReturnUrl", Request.Url.AbsoluteUri));
Response.Redirect("http://test.com/Login.aspx");
In your login page:
protected void Validate(object sender, EventArgs e)
{
// Validation code.
if (LoginValid())
{
HttpCookie cookie = Request.Cookies["ReturnUrl"];
if (cookie != null)
{
HttpCookie httpCookie = new HttpCookie("ReturnUrl");
httpCookie.Expires = DateTime.Now.AddDays(-1);
Response.Cookies.Add(httpCookie);
// Redirect to requested page.
Response.Redirect(cookie.Value);
}
}
}