问题描述
初学GridView分页有首页上一页下一页尾页文本框输入页数点GO按钮跪求后台代码怎么写??aspx页面<asp:gridviewid="GridView1"runat="server"allowpaging="True"pagesize="10"autogeneratecolumns="False"onpageindexchanging="GridView1_PageIndexChanging"><columns><asp:boundfielddatafield="CompanyName"headertext="CompanyName"sortexpression="CompanyName"/><asp:boundfielddatafield="ContactTitle"headertext="ContactTitle"sortexpression="ContactTitle"/><asp:boundfielddatafield="Phone"headertext="Phone"sortexpression="Phone"/><asp:boundfielddatafield="Fax"headertext="Fax"sortexpression="Fax"/><asp:boundfielddatafield="ContactName"headertext="ContactName"sortexpression="ContactName"/></columns><pagertemplate><tablewidth="100%"><tr><tdstyle="text-align:right">第<asp:Labelid="lblPageIndex"runat="server"text='<%#((GridView)Container.Parent.Parent).PageIndex+1%>'/>页共/<asp:Labelid="lblPageCount"runat="server"text='<%#((GridView)Container.Parent.Parent).PageCount%>'/>页<asp:linkbuttonid="btnFirst"runat="server"causesvalidation="False"commandargument="First"commandname="Page"text="首页"/><asp:linkbuttonid="btnPrev"runat="server"causesvalidation="False"commandargument="Prev"commandname="Page"text="上一页"/><asp:linkbuttonid="btnNext"runat="server"causesvalidation="False"commandargument="Next"commandname="Page"text="下一页"/><asp:linkbuttonid="btnLast"runat="server"causesvalidation="False"commandargument="Last"commandname="Page"text="尾页"/><asp:textboxid="txtNewPageIndex"runat="server"width="20px"text='<%#((GridView)Container.Parent.Parent).PageIndex+1%>'/><asp:linkbuttonid="btnGo"runat="server"causesvalidation="False"commandargument="-1"commandname="Page"text="GO"/>>
解决方案
解决方案二:
你可以采用AspNetPagerhttp://www.webdiyer.com/Controls/AspNetPager/SourceCode/AspNetPager
解决方案三:
分布控件
解决方案四:
AspNetPager这个挺好用的
解决方案五:
没有学过,嗨