protected void Page_Load(object sender, EventArgs e)
{
Server.Execute("pub.aspx");//注释掉就可以分页
if (!IsPostBack)
{
this.bindtoDataGrid();
}
}
protected void bindtoDataGrid()
{
SqlConnection con = DB.CreateConnection();
SqlDataAdapter sda = new SqlDataAdapter();
sda.SelectCommand = new SqlCommand("select a.*,(select isnull(sum(b.adcount),0) from AD800_DETAIL b where b.adid=a.id) as tcount from AD800_AD a ORDER BY a.begintime desc", con);
DataSet ds = new DataSet();
sda.Fill(ds, "emp");
this.gvGG.DataSource = ds.Tables["emp"];
this.gvGG.DataBind();
}
protected void gvGG_PageIndexChanged(object source, DataGridPageChangedEventArgs e)
{
this.gvGG.CurrentPageIndex = e.NewPageIndex;
this.bindtoDataGrid();
}各位大虾我为什么用Server.Execute("pub.aspx"); gridview 就无法分页
{
Server.Execute("pub.aspx");//注释掉就可以分页
if (!IsPostBack)
{
this.bindtoDataGrid();
}
}
protected void bindtoDataGrid()
{
SqlConnection con = DB.CreateConnection();
SqlDataAdapter sda = new SqlDataAdapter();
sda.SelectCommand = new SqlCommand("select a.*,(select isnull(sum(b.adcount),0) from AD800_DETAIL b where b.adid=a.id) as tcount from AD800_AD a ORDER BY a.begintime desc", con);
DataSet ds = new DataSet();
sda.Fill(ds, "emp");
this.gvGG.DataSource = ds.Tables["emp"];
this.gvGG.DataBind();
}
protected void gvGG_PageIndexChanged(object source, DataGridPageChangedEventArgs e)
{
this.gvGG.CurrentPageIndex = e.NewPageIndex;
this.bindtoDataGrid();
}各位大虾我为什么用Server.Execute("pub.aspx"); gridview 就无法分页
解决方案 »
- 视频播放功能
- 页面跳转问题
- 在MVC3.0 中Create页面 如果项 为dropdownlist 如何在项文字前面中添加空格?来划分层析。
- jquery 使用问题
- 这论坛怎么这样的,我发了三个一样问题的贴,就算没人回也来个回复帮忙顶顶嘛,在线登录一早上啥都没
- ASP.NET正则匹配的问题~~高手帮忙啊
- UltraWebGrid如果有嵌套子表的话,子表内容里面存在中文字符,会导致无法展开的问题!!!
- 如何将Response.Write描述的内容保存成文件?
- 怎样把整个页面Download下来的问题...
- 关于session_end以及写操作日志程序的问题。。。急
- 关于上传文件,显示文件名的问题
- 请教在c#桌面程序(也就是c/s程序)内到底能不能把系统的打印机调出来?并能打印出桌面程序界面上的一些文字或图形等?谢谢!
你
Server.Execute("pub.aspx"); 为什么 弄这个页面 不明白
if (Session["flag"] == null)
{
Response.Redirect("index.aspx");
}
防止不登录,进入管理界面