日期:2014-05-17 浏览次数:20449 次
public void PagerButtonClick(object sender, EventArgs e) { int curpage; curpage = Convert.ToInt32(Session["curpage"]); string arg = ((LinkButton)sender).CommandArgument.ToString(); switch (arg) { case "next":...; break; case "prev":...; break; case "last":...; break; default: ...; break; } }
...<tr> <asp:LinkButton ID="lb1" runat="server" CommandArgument="fir" >首页</asp:LinkButton> <asp:LinkButton ID="lb2" runat="server" CommandArgument="prev">上一页</asp:LinkButton> <asp:LinkButton ID="lb3" runat="server" CommandArgument="next">下一页</asp:LinkButton> <asp:LinkButton ID="lb4" runat="server" CommandArgument="last">末页</asp:LinkButton> </tr>...
protected void DataList1_ItemCommand(object source, DataListCommandEventArgs e) { if (e.CommandSource is LinkButton) { string arg = e.CommandArgument.ToString(); } }
------解决方案--------------------
你自己写分页代码啊?
怎么不用分页控件呢?