Dav*_*New 5 .net c# asp.net updatepanel
我希望OnRowCommand事件GridView不会在ErrorLinkButton点击上执行完整的回发.所以我将控件包装在更新面板中并添加了一个AsyncPostBackTriggerfor OnRowCommand:
<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>
Run Code Online (Sandbox Code Playgroud)
但是我收到以下错误:
无法在关联控件'DataSourceMappingGridView'上找到名为'OnRowCommand'的事件,用于UpdatePanel'ErrorUpdatePanel'中的触发器.
Ovi*_*diu 12
该事件RowCommand不是OnRowCommand
更换
EventName="OnRowCommand"
Run Code Online (Sandbox Code Playgroud)
同
EventName="RowCommand"
Run Code Online (Sandbox Code Playgroud)
它应该工作
| 归档时间: |
|
| 查看次数: |
5449 次 |
| 最近记录: |