私は C# を使用した ASPX アプリケーションを持っています。aspx ファイル内:
<table>
<tr>
<td>
<asp:GridView ID="grdClientList" runat="server" OnRowCreated="grdClientList_RowCreated"
OnRowDataBound="grdClientList_RowDataBound" AutoGenerateColumns="False"
DataSourceID="ODSClientList" DataKeyNames="ID"
AllowPaging="true" AllowSorting="true" PageSize="2"
OnPageIndexChanging="grdClientList_PageIndexChanging">
<Columns>
<asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID"
ItemStyle-CssClass="hidden" HeaderStyle-CssClass="hidden" />
<asp:BoundField DataField="Name" HeaderText="<%$Resources:HRWebApplicationResources,ClientsList_ColName %>" SortExpression="Name"
ControlStyle-Width="150px" ItemStyle-Width="150px"/>
<asp:BoundField DataField="Address" HeaderText="<%$Resources:HRWebApplicationResources,ClientsList_ColAddress %>" SortExpression="Address"
ControlStyle-Width="280px" ItemStyle-Width="280px"/>
<asp:BoundField DataField="Contact" HeaderText="<%$Resources:HRWebApplicationResources,ClientsList_ColContact %>" SortExpression="Contact"
ControlStyle-Width="100px" ItemStyle-Width="100px" />
<asp:BoundField DataField="Telephone" HeaderText="<%$Resources:HRWebApplicationResources,ClientsList_ColTelephone %>" SortExpression="Telephone"
ControlStyle-Width="100px" ItemStyle-Width="100px" />
<asp:BoundField DataField="Email" HeaderText="<%$Resources:HRWebApplicationResources,ClientsList_ColEmail %>" SortExpression="Email"
ControlStyle-Width="130px" ItemStyle-Width="130px" />
<asp:HyperLinkField
HeaderText="<%$Resources:HRWebApplicationResources,AllPages_Actions%>" ShowHeader="True" Text="Edit"
DataNavigateUrlFormatString="~/Client/ClientDetail.aspx?Id={0}"
DataNavigateUrlFields="ID" ControlStyle-Width="70px" ItemStyle-Width="70px"/>
</Columns>
</asp:GridView>
</td>
</tr>
</table>
<asp:ObjectDataSource ID="ODSClientList" runat="server" OldValuesParameterFormatString="{0}"
SelectMethod="GetAllClientsByFilter" TypeName="HRWebApplication.AppCode.ManageList">
<SelectParameters>
<asp:ControlParameter ControlID="txtSearchName" Name="p_strName" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="txtSearchAddress" Name="p_strAddress" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="txtSearchContact" Name="p_strContact" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="txtSearchTelephone" Name="p_strTelephone" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="txtSearchEmail" Name="p_strEmail" PropertyName="Text" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
cs ファイル内:
protected void grdClientList_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
grdClientList.PageIndex = e.NewPageIndex;
grdClientList.DataBind();
}
2 番目、3 番目などのページをクリックしても、アプリケーションは何もしません。「 grdClientList_PageIndexChanging」イベントに入りません。誰か理由を知っていますか?