locked
asp.net redirect page RRS feed

  • Question

  • hello guys i have a sample asp site lets say i have default.aspx and another transaction page named testing.aspx  build in visual studio 2005 for detail purposes 


    now lets say my transaction page (testing.aspx) reach the timeout period 

    i have a code on testing.aspx.cs (page_load method)

    like this 

    if session is equal to null{	response.redirect("~/default.aspx?forward=~/transaction/testing.aspx?state=1")}

     my goal for this sample code is 

    if my testing page reach the timeout period he redirect me to the default.aspx where my login page located and after authenticating he will forward to the last page and that will be the testing.aspx

    but after i applied the code to my project it will redirect to default page but it didnt go to my default forwarded page which is my testing.aspx

    really need your help guys thanks in advance

    keep safe this holly week :)

    auwi

    • Moved by Jason Dot Wang Thursday, March 28, 2013 2:28 AM This thread is about ASP.NET
    Wednesday, March 27, 2013 5:34 AM

Answers

  • hello i already got the answer in redirect on test.aspx.cs page_onload write a  that were gonna pass once you reach timeout session["URL"] with static string definition url  "~/transaciton/test.aspx?state=1" and use the session["URL"] on response.redirect(session["URL"].ToString())
    • Marked as answer by auwi987 Sunday, April 7, 2013 1:17 AM
    Sunday, April 7, 2013 1:17 AM

All replies

  • U should do something in web.config about Authentication & Authorization to set DefaultPage properties, and it will guide u there automatically.

    The default page should be loginpage.aspx.

    See more at:

    http://www.codeproject.com/Articles/98950/ASP-NET-authentication-and-authorization (Sample)

    http://www.codeproject.com/Articles/13872/Form-authentication-and-authorization-in-ASP-NET (Sample)

    http://www.4guysfromrolla.com/articles/031204-1.aspx (Detail Info)


    If you think one reply solves your problem, please mark it as An Answer, if you think someone's reply helps you, please mark it as a Proposed Answer

    Help by clicking:
    Click here to donate your rice to the poor
    Click to Donate
    Click to feed Dogs & Cats

    Wednesday, March 27, 2013 6:11 AM
  • Hi auwi,

    Welcome to the MSDN Forum.

    For ASP.NET related questions, please refer to this forum: http://forums.asp.net/

    Thanks  for your understanding and support.

    Regards,


    Lisa Zhu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, March 28, 2013 2:24 AM
  • hello i already got the answer in redirect on test.aspx.cs page_onload write a  that were gonna pass once you reach timeout session["URL"] with static string definition url  "~/transaciton/test.aspx?state=1" and use the session["URL"] on response.redirect(session["URL"].ToString())
    • Marked as answer by auwi987 Sunday, April 7, 2013 1:17 AM
    Sunday, April 7, 2013 1:17 AM