redirecting to URL of previous page RRS feed

  • Question

  • User-850215804 posted

    Hi, I'd like my application to return to the previous page after logging in, but I don't know how to do that.  So if you're on the default.aspx and then you click the login button which brings you to login.aspx, after you login i would like my code to send you back to default.aspx.  Could someone tell me how to do this from the code behind file.  The code below doesn't work, but am I close?  Thank you.

    Dim Current_Url As Uri

    Current_Url = HttpContext.Current.Request.Url


    Wednesday, April 6, 2005 1:09 PM

All replies

  • User822964765 posted

    when you made login button write current page as query string in login url and use this querystring in login page.

    if you are put your login button in custom user control use Page.Request.Path to get current page

    I hope this help

    Wednesday, April 6, 2005 11:19 PM