gridView分頁控制項

2021-06-03 07:48:20 字數 1504 閱讀 9040

using system;

using system.collections.generic;

using system.linq;

using system.web;

using system.web.ui.webcontrols;

using system.drawing;

using system.text.regularexpressions;

namespace gridviewpaging

public pagermanager(gridview gridview)

private void dopaging()

public void dopaging(gridview g)

public void dopaging(int page)

public void dopaging(int page, gridview g)

void _gridview_rowcreated(object sender, gridviewroweventargs e)

}private void genedigitnum(object sender,tablecell tmp) }}

private string genepre(object sender)

private string genepage(object sender)

void pagebuttonclick(object sender, eventargs e)

else

break;

case "previous":

if (tmpgridview.pageindex >= 1)

else

break;

case "last":

tmpgridview.pageindex = tmpgridview.pagecount - 1;

tmpgridview.databind();

clickedbutton.enabled = false;

break;

case "1":

tmpgridview.pageindex = 0;

tmpgridview.databind();

break;}}

else

}private bool validataisdigist(string strcommand)quot;;

string rex = @"^[0-9]*quot;;

return regex.ismatch(strcommand, rex);

}void _gridview_pageindexchanging(object sender, gridviewpageeventargs e)}}

前台演示**:

protected void page_load(object sender, eventargs e)

有圖有真相:

GridView控制項分頁顯示資料

using system using system.collections.generic using system.linq using system.web using system.web.ui using system.web.ui.webcontrols using system.conf...

GridView控制項實現分頁功能

初識asp.net中的控制項,還是折騰了一小會兒,就把我折騰的結果給大家看看 顯示資料時 開發中的乙個常見的功能,asp.net提供了很多任務具在網頁中顯示 gridview控制項就是最常見的乙個,下面說說如何實現這個控制項的分頁功能。首先我在資料庫中建好了一張表,裡面輸入了一些學生的資訊,資料表是...

分頁技術之GridView控制項

5455 5657 5859 view code gridview container.parent.parent pageindex 1獲取當前控制項顯示的頁面數 gridview container.parent.parent pagecount獲取當前控制項總的頁面數 causesvalida...