在Webform中将PostBackTrigger更改为AsyncPostBackTrigger之后,我无法在gridview中添加多个行,并且所有触发器均被禁用。我只更改了以下代码:
<asp:UpdatePanel ID="up_JournalVoucher" runat="server" UpdateMode="Conditional">
...
<FooterTemplate> <asp:Button ID="btn_Add" runat="server" Text="Add" ValidationGroup="Add" ToolTip="Add New Row" CommandName="Add" CssClass="btn btn-info" /> </FooterTemplate> </asp:TemplateField>
...
...
</div>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="lnk_Back" />
<asp:AsyncPostBackTrigger ControlID="ddl_MainDonor" />
<asp:AsyncPostBackTrigger ControlID="gv_JournalVoucher" />
<asp:PostBackTrigger ControlID="btn_Save" />
<asp:PostBackTrigger ControlID="btnUpload" />
<asp:PostBackTrigger ControlID="btnDownload" />
</Triggers>
</asp:UpdatePanel>
</asp:Content>
这里,我仅将ddl_maindonor和gv_journalvoucher控件id的回发触发器更改为asyncPostBackTrigger。