0
我有以下的局部視圖:關閉jQueryUI的對話框
@using (Ajax.BeginForm("EditUserRole", "Administrator", null, new AjaxOptions{ OnSuccess = "CloseWnd()"))
{
<input type="submit" class="jqBtn" />
}
我阿賈克斯得到這個並將其插入到這樣的對話:
@Ajax.ActionLink(" ", "GetEditUserRoleControl", new { userId = x.UserId }, new AjaxOptions { UpdateTargetId = "WndContent", OnSuccess="OpenWnd('Edit User Roles')" }, new { @class = "ui-icon ui-icon-person BtnIcon" })
<div id="WndContent" style="display: none;">
</div>
<script>
function OpenWnd(title) {
var $dialog = $("#WndContent").dialog({ title: title, modal: true });
//get the widget element
var $widg = $dialog.dialog('widget');
//find all buttons and apply button:
$("input:submit.jqBtn", $widg).button();
}
</script>
我在提交表單後需要關閉框。但似乎我會在取決於對話框的部分控件中編寫代碼。我也不想使用內置的jquery按鈕,因爲我必須從部分表單中刪除按鈕。任何幫助?