我爱Aspx >> Asp.Net >> EnableViewState="false"的DataGrid分页pager.Controls.AddAt(i,hl);
}
else
{
Label l = (Label) o;
l.Text = "Page " + l.Text;
}
}
}
}
protected void Page_Load(Object sender, EventArgs e)
{
if(!Page.IsPostBack){
int pageIndex=0;
try{pageIndex=Int32.Parse(Request["page"])-1;}catch(Exception ex){}
Response.Write(MyDataGrid.PageCount);
MyDataGrid.CurrentPageIndex=pageIndex;
BindData();
}
}
void BindData(){
//绑定数据库,略
}
</script>
<HTML>
<body>
<form id="Form1" method="post" runat="server">
<asp:datagrid id="MyDataGrid" runat="server" EnableViewState="false" AllowPaging="True" PageSize="10"
OnItemCreated="ItemCreated"
PagerStyle-BackColor="#FFFFFF"
PagerStyle-HorizontalAlign="Right"
PagerStyle-Mode="NumericPages">
</asp:datagrid>
</form>
</body>
</HTML>
Ҷƪл˵?
C#四种Eval测试结果:不要用Code..[05-20]
不停向上滚动的图片 JavaScript[05-20]
比较ASP.NET1.x的Code Behind和A..[05-20]
关于MSSQL Server中DATETIME类型..[05-20]
巧用*.UDL文件,获取数据库连接字..[05-20]
CSS中的!important[05-20]
什么是XSLT[05-20]
DIV&CSS布局入门[05-20]
XHTML教程[05-20]
为什么要使用 CSS?[05-20]