后台代码
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Bind();
}
} DataClassesDataContext db = new DataClassesDataContext(); public void Bind()
{
var resultQuery1 = from c in db.proc_Selectkqxx()
select c;
GridView1.DataKeyNames = new string[] { "Yno" };
GridView1.DataSource = resultQuery1;
GridView1.DataBind();
}
Gridview的AllowPaging设置为true,运行时还是显示Gridview不支持数据库端的分页,困惑啊,我的另一个页面这么写却可以分页,真的不懂到底怎么了
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Bind();
}
} DataClassesDataContext db = new DataClassesDataContext(); public void Bind()
{
var resultQuery1 = from c in db.proc_Selectkqxx()
select c;
GridView1.DataKeyNames = new string[] { "Yno" };
GridView1.DataSource = resultQuery1;
GridView1.DataBind();
}
Gridview的AllowPaging设置为true,运行时还是显示Gridview不支持数据库端的分页,困惑啊,我的另一个页面这么写却可以分页,真的不懂到底怎么了
用这个分页控件吧,里面有现成的例子。
一般情况下就不要用Gridview 了,用dataList会更好一些,以后你会慢慢体会到,或者repeater 控件也可以