I am stuck with this issue for the past 4 hours. I m displaying a partial view in a jquery modal dialog. Everything works fine until I noticed that when I load the dialog the first time it does a post to the controller for the action specified but all subsequent clicks to open the dialog does not do any post at all.
I have a link button clicking on which should open the dialog, the first time I see it does a post the next time no post happens at all. Kindly look at my code and please suggest a solution. I have tried most of the solutions provided but none of them work. Here is the code.
$(document).ready(function () {
//Modal window for Payment Summary
$('.button-link').on('click', function () {
//$('body').find("#paymentSummaryForm").remove();
$("#paymentSummaryForm").dialog({
dialogClass: 'no-titlebar',
autoOpen: true,
position: { my: "center", at: "top+410", of: window },
width: 1000,
height: 750,
resizable: false,
draggable:true,
//title: 'Payment Summary',
modal: true,
open: function (event, ui) {
$(this).load('@Url.Action("PaymentSummaryView", "Home", new {id= @DateTime.Now.ToShortTimeString() })');
},
buttons: {
Close: function () {
$(this).dialog("close");
}
}
});
return false;
});
This is the code which triggers the dialog
<tbody>
<tr>
<td>
<button type="button" class="button-link">
@Model.AcctNumber
</button></td>
</tr>
</tbody>
</table>
I have tried the destroy, empty and lot of other options..none of them seem to work. Please help me.