locked
Web Page has expired RRS feed

  • Question

  • User937468370 posted

    Hi Folks,

    I am facing issue of Page as 'Web page expired' when I am trying to get back to previous page, Its working in Google Chrome but not working in Mozilla and IE.

    Below is the line where I am clicking

    <a href="#" onclick="history.go(-1);return false">Back</a>

    Please help on this..

    Regards,

    Ganesh

    Monday, December 5, 2016 7:22 AM

All replies

  • User-284744251 posted

    Following link contains possible reason why you are getting "web page expired" message

    http://stackoverflow.com/questions/6533960/browser-history-in-javascript

    Monday, December 5, 2016 7:10 PM
  • User1724605321 posted

    Hi GaneshAtkale,

    Please refer to this explanation : http://stackoverflow.com/a/1580126/5751404 

    Well, by default whenever you're dealing with a form POST, and then the user hits back and then refresh then they'll see the message indicating that the browser is resubmitting data. But if the page is set to expire immediately then they won't even have to hit refresh and they'll see the page has expired message when they hit back.

    To avoid both messages there are a couple things to try:

    1) Use a form GET instead. It depends on what you're doing but this isn't always a good solution as there are still size restrictions on a GET request. And the information is passed along in the querystring which isn't the most secure of options.

    -- or --

    2) Perform a server-side redirect to a different page after the form POST.

    Best Regards,

    Nan Yu

    Tuesday, December 6, 2016 5:29 AM
  • User937468370 posted

    Thanks for the reply Nan Yu.

    Still issue persists.

    Please let me know where I need to add GET Method or where I should place the cache code.

    I tried below code but its not working.. Please assist

    Response.Cache.SetCacheability(HttpCacheability.Public);
            Response.Cache.SetMaxAge(new TimeSpan(1, 0, 0));

    Response.Cache.SetCacheability(HttpCacheability.Public);
            Response.Cache.SetMaxAge(new TimeSpan(1, 0, 0));

    Tuesday, December 6, 2016 6:45 AM
  • User-693045842 posted

    HI ,

    You code should work in IE ,  :

    <a href="#" onclick="history.go(-1);return false">Back</a>


    how do you redirect to current page ?
    Tuesday, December 6, 2016 7:42 AM
  • User-474980206 posted

    as suggested you should use the PRG (post/redirect/get) pattern:

       https://en.wikipedia.org/wiki/Post/Redirect/Get

    Tuesday, December 6, 2016 4:26 PM
  • User937468370 posted

    Thanks for reply.

    This is code only to redirect at Previous stage, how we moved ahead,  respectively those steps we come back (history wise) .

    When we come back with history of same page, It works, after last stage if we get back from same page to previous page (data contained page) then its not working.

    Please assists...

    Wednesday, December 7, 2016 8:45 AM
  • User-693045842 posted

    It works, after last stage if we get back from same page to previous page (data contained page) then its not working.

    Explain more about your scenario and try get as explain above

    Wednesday, December 28, 2016 7:47 AM