我在更新面板中使用了一个按钮和一个网格,当用户点击该按钮时,结果会在此网格中更新
但是这个按钮不会引发任何点击事件,因为哪些代码无法触及代码。
以下是我正在使用的HTML代码
<div id="DivGridPendingCRSeeMore" class="editableDialogContentPanel" style="display: none">
<asp:UpdatePanel ID="RecentGridPendingCRSeeMore" runat="server">
<ContentTemplate>
<asp:Button ID="ButtonRecentGridPendingCRSeeMoreSearch" runat="server" Text="Search"
OnClick="ButtonRecentGridPendingCRSeeMoreSearch_Click" />
<asp:GridView ID="GridPendingCRSeeMore" runat="server" AllowSorting="true" AllowPaging="true"
PageSize="20" AutoGenerateColumns="false" PagerSettings-Visible="false" RowStyle-CssClass="gridDataRow"
CssClass="grid">
<Columns>
<asp:HyperLinkField HeaderText="Request ID" DataTextField="Request_ID" SortExpression="Request_ID"
DataNavigateUrlFields="Request_ID" DataNavigateUrlFormatString="ChangeRequestDetails.aspx?RequestID={0}"
HeaderStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Territory ID" DataField="Territory_ID" SortExpression="Territory_ID"
HeaderStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Submitted By" DataField="Submitted_By_Name" SortExpression="Submitted_By_Name"
ItemStyle-Wrap="false" HeaderStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Owner" DataField="owner_name" SortExpression="owner_name"
ItemStyle-Wrap="false" HeaderStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Type" DataField="Request_Type" SortExpression="Request_Type"
ItemStyle-Wrap="false" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField HeaderText="Status" DataField="CR_Status" SortExpression="CR_Status"
ItemStyle-Wrap="false" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField HeaderText="Date Submitted" DataField="Submit_Date" SortExpression="Submit_Date"
DataFormatString="{0:MM/dd/yyy}" HtmlEncode="false" HeaderStyle-HorizontalAlign="Center"
ItemStyle-HorizontalAlign="Center" />
<asp:BoundField HeaderText="Description (ID or Name)" DataField="Description" SortExpression="Description"
ItemStyle-Wrap="false" HeaderStyle-HorizontalAlign="Left" />
</Columns>
</asp:GridView>
<UC1:PagerControl ID="HomePendingCRPager" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
以下是处理程序背后的代码
Protected Sub ButtonRecentGridPendingCRSeeMoreSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonRecentGridPendingCRSeeMoreSearch.Click
End Sub
答案 0 :(得分:0)
在Trigger
中添加UpdatePanel
,如下所示
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ButtonRecentGridPendingCRSeeMoreSearch" EventName="Click"/>
</Triggers>