0

I display some data popup when I clicked on my productlist page. These data are stored as session values and retrieve from controller by calling ajax method. But if I used browser back button, this ajax method is not calling controller method. But my data popup is showing some data. but not the latest changes. Can anyone help me by showing way to call the controller method in browser back button click too.

Thanks

$(document).ready(function () {
             $.ajax({
                type: 'GET',
                url: url,
                data: param = "",
                success: function (data) {
                        var popupPanel = $('.test');
                        popupPanel.html(data);
                    }
                 }
            });
        });
Kate Fernando
  • 381
  • 1
  • 4
  • 18
  • 1
    Refer this question https://stackoverflow.com/questions/8788802/prevent-safari-loading-from-cache-when-back-button-is-clicked – Kung Fu Panda May 29 '17 at 04:10
  • You may want to read about browser's [popstate event](https://developer.mozilla.org/en-US/docs/Web/Events/popstate). Try to listen to this event and fire your AJAX calls based on the requirements. – 31piy May 29 '17 at 04:49

1 Answers1

0

Thanks for the help.I have found an easy answer that I can apply from server side.

 [OutputCache(NoStore = true, Duration = 0)]
 public virtual ActionResult ShowPopup(){}
Kate Fernando
  • 381
  • 1
  • 4
  • 18