第七天
學習目的
雖然說DATAGRID的分頁顯示效率不怎麼高
<script runat=
void Page_Load()
{
string strConnection=
strConnection+=Server
OleDbConnection objConnection=new OleDbConnection(strConnection);
OleDbDataAdapter objDataAdapter=new OleDbDataAdapter(
DataSet objDataSet=new DataSet();
objDataAdapter
dgrdMain
dgrdMain
}
void dgrdMain_PageIndexChanged(Object sender
{
dgrdMain
DataBind();
}
</script>
<html>
<body>
<asp:DataGrid
id=
cellpadding=
showheader=
borderwidth=
allowpaging=
pagesize=
onpageindexchanged=
runat=
/>
</body>
</html>
<script runat=
subPage_Load
dim objConnection as OleDbConnection
dim objDataAdapter as OleDbDataAdapter
dim objDataSet as DataSet
objConnection=new OleDbConnection(
objDataAdapter=new OleDbDataAdapter(
objDataSet=new DataSet
objDataAdapter
dgrdMain
dgrdMain
end sub
sub dgrdMain_PageIndexChanged(sender as object
dgrdMain
DataBind
end sub
</script>
<html>
<body>
<asp:DataGrid
id=
cellpadding=
showheader=
borderwidth=
allowpaging=
pagesize=
onpageindexchanged=
runat=
/>
</body>
</html>
這樣就是最簡單的分頁
今天就說到這裡
From:http://tw.wingwit.com/Article/program/net/201311/15664.html