datagrid 分页问题 在发(在线)
这个是我写的分页代码,点下一页的时候它不显示下一页信息,请大哥们看看
着急啊~~~
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class admin_cus_manage_shiyan : System.Web.UI.Page
{
protected SqlConnection con;
protected SqlDataAdapter sda;
protected DataSet ds;
protected string strsql;
protected void Page_Load(object sender, EventArgs e)
{
strsql = "select business_id,[User_name],Business_name,Business_company,Business_issuance from business where Business_authentication= 'n ' ";
BindGrid(strsql);
}
protected void BindGrid(string sql)
{
con = new SqlConnection(ConfigurationSettings.AppSettings[ "Str_sql "]);
sda = new SqlDataAdapter(sql, con);
ds = new DataSet();
sda.Fill(ds);
DataGrid1.DataSource = ds.Tables[0].DefaultView;
DataGrid1.DataBind();
}
protected void DataGrid1_PageIndexChanged(object source, DataGridPageChangedEventArgs e)
{
DataGrid1.CurrentPageIndex = e.NewPageIndex;
BindGrid(strsql);
}
protected void LinkButton2_Click(object sender, EventArgs e)
{
if (DataGrid1.CurrentPageIndex < (DataGrid1.PageCount - 1))
{
DataGrid1.CurrentPageIndex += 1;
}
BindGrid(strsql);
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
if (DataGrid1.CurrentPag