我以这种方式打开UI对话框:
var $dialog = jQuery('#dialog');
$dialog.load('mySite.aspx');
$dialog.dialog({
autoOpen: false,
title: 'Add New Contact Personel',
modal: true,
height: 350,
width: 400,
show: 'puff',
hide: 'puff',
close: function (event, ui) {
$dialog.html('');
$dialog.dialog('destroy');
}
});
$dialog.dialog('open');
并且在我使用右上方corent中的十字架关闭之后,所有其他没有连接到UI对话框的按钮都不起作用,例如gridview下面的linkButton失去了意义,在firefox中没有用,在chrome重定向到页面使用了哪个非常昂贵的UI对话框,但是当我刷新页面时,一切似乎工作正常,直到我再次单击打开UI对话框,然后所有其他链接都无法再次工作。
<asp:GridView ID="userGridView" runat="server"
AutoGenerateColumns="False"
GridLines="None"
AllowPaging="true"
DataKeyNames="UserId"
OnRowCommand="UserGridViewRowCommand">
<Columns>
<asp:BoundField DataField="UserId" Visible="false"/>
<asp:BoundField DataField="FirstName" HeaderText="First Name" />
<asp:TemplateField HeaderText="Actions" HeaderStyle-Width="75px" ItemStyle-HorizontalAlign="Center" >
<ItemTemplate>
<asp:LinkButton ID="ChartLinkBtn" ToolTip="go to EAS (user page)" CommandArgument='<%# Eval("UserId") %>' CommandName="User" runat="server"><img src="../Styles/icons/chart.png" style="border:0px" alt="text"/></asp:LinkButton>
<asp:LinkButton ID="DeleteLinkBtn" ToolTip="delete this user" CommandArgument='<%# Eval("UserId") %>' CommandName="Delete" runat="server"><img src="../Styles/icons/delete.png" style="border:0px" alt="text"/></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
答案 0 :(得分:2)
如果这有任何帮助,为什么不完全强制完全回发?
close: function (event, ui) {
$dialog.html('');
$dialog.dialog('destroy');
__doPostBack(); //to perform a full postback
}
或试试这个(把它放在javascript标签中)......
Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(function (evt, args) {
var myDiv = $("#dialog").dialog({ autoOpen: false, modal: true, open: function (type, data) {
$(this).parent().appendTo("form");
}
});
});
喝彩!