在SqlDataSource 的Selected方法中添加如下
protected void SqlDataSource1_Selected(object sender, SqlDataSourceStatusEventArgs e)
{
Label4.Text = "共有记录:"+ e.AffectedRows.ToString()+"条";
}
在页面添加个Label
显示页数量和当前页数GridView的RowDataBound中添加如下代码:
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
int num = GridView1.PageIndex + 1;
Label6.Text = "第" + num + "页/共" + GridView1.PageCount + "页";
}
程序代码
protected void SqlDataSource1_Selected(object sender, SqlDataSourceStatusEventArgs e)
{
Label4.Text = "共有记录:"+ e.AffectedRows.ToString()+"条";
}
在页面添加个Label
显示页数量和当前页数GridView的RowDataBound中添加如下代码:
程序代码
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
int num = GridView1.PageIndex + 1;
Label6.Text = "第" + num + "页/共" + GridView1.PageCount + "页";
}