日期:2014-05-18  浏览次数:20466 次

模拟点击gridview页尾分页按钮
我的gridview的页尾有一分页跳转按钮btnGo

C# code

转到<asp:TextBox ID="txtNewPageIndex" runat="server" 
                        Text="<%# ((GridView)Container.Parent.Parent).PageIndex + 1%>" Width="20px"</asp:TextBox>
 <asp:ImageButton ID="btnGo" runat="server" CausesValidation="False" 
    CommandArgument="-1" CommandName="Page" ImageUrl="~/images/go.jpg" />


现在我想通过后台代码来模拟点击这个跳转按钮以实现页面跳转效果,不知如何实现

------解决方案--------------------
后台设置一下页码是第几页不就完事了吗?

非把问题复杂化。
------解决方案--------------------
可以参考:
http://www.cnblogs.com/insus/articles/1417102.html
http://www.cnblogs.com/insus/articles/1417957.html
------解决方案--------------------
是啊找到最后一页设置PageIndex就行咯