ASPX code:
Aspx.cs Code:
protected int pcount = 0; Total number of bars protected void Page_Load (object sender, EventArgs e) { if (! IsPostBack) { _pcmanager PCM = new _pcmanager (); Pcount = PCM. Gettotalcount (); Get total number of bars } }
ASMX code:
[WebMethod (Description = "Get Paging data, return DataSet")] Public DataSet getbindsource (int PageSize, int PageIndex) { _pcmanager PCM = new _pcmanager (); Return PCM. Getlistbypage (PageSize, PageIndex); }
SQL stored procedures:
ALTER proc [dbo]. [Getpcinfobypage] @pageSize int, @pageIndex intasdeclare @pageCountStart intset @pageCountStart = @pageSize * @ Pageindexdeclare @pageCountEnd Intset @pageCountEnd = @pageSize * (@pageIndex + 1) SELECT * FROM (select Row_number () over (Order by ID ASC) Row,*from pcinfo) Twhere t.row> @pageCountStart and T.row<[email protected]
Effect:
Source Code Link: Http://pan.baidu.com/s/1sl8OySH
ASP. NET Practice ②--paginaton No Refresh Paging