我正在Button2
上的数据库中检索下载网址,但是当我将GridView
放入UpdatePanel
时,它会出现以下错误:
Microsoft JScript运行时错误:Sys.WebForms.PageRequestManagerParserErrorException:
代码:
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False"
DataSourceID="SqlDataSource1" ShowHeaderWhenEmpty="True"
EmptyDataText="No Uploads are found" ShowEmptyTable="True"
ShowFooterWhenEmpty="False" Style="margin-top: 20px"
OnSelectedIndexChanged="GridView2_SelectedIndexChanged"
OnRowDataBound="GridView2_RowDataBound">
<asp:TemplateField ShowHeader="False" HeaderText="Receive">
<ItemTemplate>
<asp:Button ID="Button2" runat="server" CausesValidation="false" CommandName="select" Text="Receive" />
</ItemTemplate>
</asp:TemplateField>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
答案 0 :(得分:1)
尝试在UpdatePanel中添加触发器:
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Button2" EventName="Click" />
</Triggers>