分页不显示,也不报错
Fpage 类:
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 fenye : System.Web.UI.Page
{
public string con_str, sql_str;
protected void Page_Load(object sender, EventArgs e)
{
con_str = "server=.;uid=sa;pwd=sa;database=pubs ";
sql_str = "select * from titles ";
Fpage fenye = new Fpage(con_str,sql_str);
//fenye.fkai(con_str,sql_str);
Repeater1.DataSource = fenye.Pds;
Repeater1.DataBind();
Label1.Text = fenye.dqy;
Label2.Text = fenye.ygy;
Firstpage.NavigateUrl = fenye.syy;
Nextpage.NavigateUrl = fenye.xyy;
}
}
cs :
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 fenye : System.Web.UI.Page
{
public string con_str, sql_str;
protected void Page_Load(object sender, EventArgs e)
{
con_str = "server=.;uid=sa;pwd=sa;database=pubs ";
sql_str = "select * from titles ";
Fpage fenye = new Fpage(con_str,sql_str);
//fenye.fkai(con_str,sql_str);
Repeater1.DataSource = fenye.Pds;
Repeater1.DataBind();
Label1.Text = fenye.dqy;
Label2.Text = fenye.ygy;
Firstpage.NavigateUrl = fenye.syy;
Nextpage.NavigateUrl = fenye.xyy;
}
}
[解决办法]
你类里原来是怎么样写的啊?
[解决办法]
con_str = "server=.;uid=sa;pwd=sa;database=pubs ";
sql_str = "select * from titles ";
Fpage fenye = new Fpage(con_str,sql_str);
//fenye.fkai(con_str,sql_str);
Repeater1.DataSource = fenye.Pds;
Repeater1.DataBind();
Label1.Text = fenye.dqy;
Label2.Text = fenye.ygy;
Firstpage.NavigateUrl = fenye.syy;
Nextpage.NavigateUrl = fenye.xyy;
--------------
这些应当放在if(!ispostback)
你这种写法不好