I am developing one MVC4 application where I am displaying some information on Modal popup. I am able to display the required information. If I refresh the page when the Modal is open the current Modal will close. Is there any way to stop closing the Modal on page refresh?
This is my Modal code.
function cancel(upload_Id) {
if (!$("#formID").validationEngine('validate')) {
return false;
}
$("#id").val(upload_Id);
$(".reject-popup-inner").parents('div').addClass('reject-popup');
$("#dialog-form").dialog("open");
}
<div id="dialog-form" title="Reject Reason" class="reject-popup-inner">
<div>
<input type="hidden" value="_upload_id" id="id" /><br />
<label for="name">Select your reason below</label>
<select id="comments">
<option value="0">Wrong Document</option>
<option value="1">Incorrect Document</option>
<option value="2">document is not clear</option>
<option value="3">document is not valid</option>
<option value="4">other document</option>
</select>
<input type="button" id="reject" class="btn btn-primary btn-cons blue" value="Ok" onclick="reject();" tabindex="-1" style="float:right;">
</div>
</div>
jQuery Modal code
$("#dialog").dialog({
modal: true,
title: "Preview of " + FileName,
width: 850,
closeOnEscape: false,
height: 600,
buttons: {
Close: function () {
$(this).dialog('close');
deleteFile(FileName);
}
},
});
});
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…