Jquery ui对话关闭事件?

时间:2012-07-10 14:19:12

标签: asp.net-mvc jquery-ui dialog

我想在关闭对话框时刷新页面?这可能吗?我怎样才能做到这一点? 有链接可以打开自己的对话框。但是当我第一次点击任何链接时,对话框缓存它的id,然后我点击其他链接,链接ID始终相同(首先点击的ID)。

关闭对话框时是否应该刷新页面?还是有其他方法可以解决此问题。

我使用下面的代码打开对话框:

@foreach (var item in Model)
{
   <tr>
       <td>@Html.ActionLink(linkText: item.musteri_adi,
           actionName: "MusteriDuzenle",
           controllerName: "Musteri",
           routeValues: new { sno = item.sno },
           htmlAttributes: new { @class = "open_dialog", data_dialog_title = item.musteri_adi })
       </td>
       <td>@Html.DisplayFor(x => item.fatura_adresi)
       </td>
   </tr>
}

感谢。抱歉,我的英语很差:)。

1 个答案:

答案 0 :(得分:4)

您可以使用 beforeClose 事件调用函数来刷新页面。

$( "#myDialog" ).dialog({
   beforeClose: function(event, ui) {
      window.location.reload(); 
      // or you can use window.location = 'mypage.html';
}
});