locked
How can I redirect the page when time out happens in asp.net. RRS feed

  • Question

  • User-1202100973 posted

    Hi Every one,

    I am having a Asp.net web Application.

    I want to embed the time out functionality in my Application.

    i.e If no activity is done I want to redirect when time out happens.

    So I have added the code in the web config.

    <sessionState timeout="10"></sessionState>

    And In my Global.ascx at the

       void Session_End(object sender, EventArgs e)

            {

                Response.Redirect("~/Expired.aspx",false);

    //Error Msg {"Response is not available in this context."}

              HttpContext.Current.Response.Redirect("~/Expired.aspx");

    //Error Msg Object referenced to a null.  }

    I am not sure what wrong in my code.

    Any suggestions Pls.

     

    Tuesday, February 7, 2017 11:02 PM

Answers