问题描述
前台就一个2个多选按钮点几排序一翻页就没效果了求请如何绑定谁会帮帮我以下是后台代码数据库是SQL2000绑的jobs表usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.Web.UI.HtmlControls;publicpartialclass_Default:System.Web.UI.Page{DBcondb=newDBcon();protectedvoidPage_Load(objectsender,EventArgse){if(!Page.IsPostBack){bind();}}publicvoidbind(){PagedDataSourceObjpage=newPagedDataSource();Objpage.DataSource=db.Search("select*fromjobs").DefaultView;Objpage.AllowPaging=true;Objpage.PageSize=4;intcurpage;if(Request["page"]!=null){curpage=int.Parse(Request["page"]);}else{curpage=1;}Objpage.CurrentPageIndex=curpage-1;if(!Objpage.IsFirstPage)pre.NavigateUrl=Request.CurrentExecutionFilePath+"?page="+Convert.ToString(curpage-1);if(!Objpage.IsLastPage)next.NavigateUrl=Request.CurrentExecutionFilePath+"?page="+Convert.ToString(curpage+1);this.DataList1.DataSource=Objpage;lblye.Text=curpage.ToString()+"页";this.DataList1.DataBind();}protectedvoidButton1_Click(objectsender,EventArgse){if(CheckBox1.Checked){DataList1.DataSource=db.Search("select*fromjobsorderbyjob_id");DataList1.DataBind();}if(CheckBox2.Checked){DataList1.DataSource=db.Search("select*fromjobsorderbyjob_iddesc");DataList1.DataBind();}}}
解决方案
解决方案二:
protectedvoidPage_Load(objectsender,EventArgse){//不使用IsPostBack//if(!Page.IsPostBack)//{bind();//}}
解决方案三:
起用了ViewState吗?
解决方案四:
点完下一页他又从新绑定了又变回原来的了
解决方案五:
谁来帮帮我啊