How to handle IE8 popup after AJAX post call from jQuery UI dialog ?
Hi I have put a form into a jquery UI dialog, after the user submits the form the data gets inserted into an MS SQL table and then I would like the dialog to close and the page to refresh showing the data that was just inserted. When done in Internet Explorer 8 a warning box generated by the browser pops up saying 'To display the webpage again, the web browser needs to resend the information you've previously submitted' ...
I have tried different Javascript methods such as:
window.location='<%= ResolveUrl("Default.aspx") %>'
location.href = location.href ~ (??? is this the correct usage and syntax ??? )~ nothing happens here
I've read about Post Redirect Get methods, but am having a hard time finding an example of how to implement this...
Would I put my $.ajax "Get" nested in the "POST" $.ajax function ?
...hope my question makes sense and I can provide more code if needed, but wanted to be as succinct as possible ...
Hi leakim, thank you for your suggestion, it has triggered a different method to fix this, however, if I do a server side insert, I will still have to refresh the page, it will still generate this pop up. I'd like to try to find a way to do an ajax post and reload without having this popup generated ...
leakim971
No, you don't a popup when posting
Scarlett72
ASKER
Hi, following upwith the resolution to my issue raised in the GeekOut … I was able to resolve this by implementing the following:
function InsertCode() { var insertcode = {}; insertcode.name = $("#lblAdminName").text(); insertcode.pein = $("#lblAdminPein").text(); insertcode.dte = $(".diagDte").text(); insertcode.code = $("#ddlCodes").val(); insertcode.duration = $("#ddlDuration").val(); insertcode.getYear = $("#ddlYear").val(); insertcode.getID = $("#tdID").val(); alert(insertcode.getID); $.ajax({ type: "POST", url: "WebMethods.aspx/Insert1964", data: '{insertcode: ' + JSON.stringify(insertcode) + '}', contentType: "application/json; charset=utf-8", dataType: "json", success: function (response) { { window.location.reload() //…this was causing the pop up ... removed this line $("#dialog-1").dialog('close'); }; }, error: function (result) { alert(result.responseText); } }); __doPostBack('', ''); //postback outside of ajax method ... added this return false; } }
Hi leakim, your answer wasn't the solution in the end, but you are correct that this is probably the wrong way to go about doing what I need to do, and will have to circle around the issue for a more efficient solution, but __doPostBack is working for me now. Thank you for taking the time to respond...