【发布时间】:2013-11-04 21:05:43
【问题描述】:
我希望GridView 的OnRowCommand 事件不对ErrorLinkButton 点击执行完整的回发。因此,我将控件包装在更新面板中,并为OnRowCommand 添加了AsyncPostBackTrigger:
<asp:GridView ID="DataSourceMappingGridView" runat="server" DataKeyNames="Index" ClientIDMode="Static" OnRowCommand="DataSourceMappingGridView_RowCommand" OnRowDataBound="DataSourceMappingGridView_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:UpdatePanel ID="ErrorUpdatePanel" runat="server">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="DataSourceMappingGridView" EventName="OnRowCommand" />
</Triggers>
<ContentTemplate>
<asp:LinkButton ID="ErrorTextLinkButton" CommandName="Errors" CommandArgument='<%#Bind("Index") %>' runat="server" Text='View Errors' />
</ContentTemplate>
</asp:UpdatePanel>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
但我收到以下错误:
在关联控件上找不到名为“OnRowCommand”的事件 UpdatePanel 中触发器的“DataSourceMappingGridView” '错误更新面板'。
【问题讨论】:
标签: c# asp.net .net updatepanel