0

Current behaviour: I have a Main Page with the button "Import" which will show a popup window when it gets clicked. If I exit the popup and back to main menu, again I click the "Import" button it shows the popup window(without updating).

Note:

  1. This is not due to page refreshment, even the page refreshed it behaves the same.
  2. The only way to force the application to update the "Import" is to exit and return into the application.

Please give me if you have any suggestions. My code looks like:

function ImportData() {
$("<div></div>")
    .addClass("dialog")
    .attr("id", $(this)
    .attr("data-dialog-id"))
    .appendTo("body")
    .dialog({
        title: $(this).attr("data-dialog-title"),
        close: function () { $(this).remove(); },
        modal: true,
        position: ['center',200],
        height: 250,
        width: 800,
        resizable: false,
        left: 0
    })
   .load("/Index/ImportCase");

My html for button:

   <button onclick="ImportData()" class="MenuPageButton" data-dialog-id="CaseImportData" data-dialog-title="Case Selection (Upload)"> Import Data </button>.
Ben
  • 2,433
  • 5
  • 39
  • 69
Kavitha P.
  • 155
  • 1
  • 2
  • 13

2 Answers2

0

Please preferred link which i have mentioned below, in this you can call a pertialview in a popup as per your requirement.

MVC-pop up windows

Community
  • 1
  • 1
  • try this tutorial step by step. http://www.codeproject.com/Articles/315535/How-to-render-MVC-View-on-a-Modal-Popup-Window – Sunil Kumawat Mar 25 '15 at 06:40
0

You have two options, turn off the caching globally

// make sure this is called before any of your ajax call is called
$.ajaxSetup ({
// Disable caching of ajax responses
cache: false
});

or use the longer form of load

$.ajax({
url: '/Home/MyActionMethod?id=' + id,
cache: false
});
Kavitha P.
  • 155
  • 1
  • 2
  • 13