locked
disable the back button from code behind in asp.net RRS feed

  • Question

  • User351619809 posted

    <div class="post-text" itemprop="text">

    I am trying to disable the back button from code behind in asp.net. I already know how to do it in javascript. I have the following code in my page_init method, but I can still see the back button enabled in chrome:

    protected void Page_Init(object sender, EventArgs e)
        {
            Response.Cache.SetCacheability(HttpCacheability.NoCache);
            Response.Cache.SetExpires(DateTime.Now.AddSeconds(-1));
            Response.Cache.SetNoStore();
        }

    I want the button to be disabled so that the user cannot click on it.

    Wednesday, July 15, 2020 1:43 PM

Answers

All replies