【发布时间】:2017-04-24 11:22:04
【问题描述】:
我在模式对话框中绑定数据时遇到问题。 我有一个类似的 ascx 文件
<asp:Panel ID="ModalDialog" runat="server" Style="display: none;">
<asp:UpdatePanel runat="server" ID="UpdatePanel" ChildrenAsTriggers="true" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView runat="server" ID="ResultGridTest" AutoGenerateColumns="true" ShowHeader="true" Width="100%" />
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="ResultGridTest" />
</Triggers>
</asp:UpdatePanel>
</asp:Panel>
模态对话框作为 jquery 对话框打开
$j("#ModalDialog").dialog("open");
问题是,当我尝试在处理方法中将数据绑定到 ResultGridTest 时,该方法会触发来自另一个控件的传递值,ResultGridHas 没有任何可见数据。 我的处理方法:
protected void GridViewControl_DataBindGridView(object sender, PassSelectedValuesEventArgs<Model> e)
{
ResultGridTest.DataSource = e.SelectedItems;
ResultGridTest.DataBind();
}
您知道如何在我的模式对话框中发生事件后绑定数据吗? 请帮忙
【问题讨论】: