ajax问题 急急急!! 高手支招啊
ajax分页谁会啊 教教小弟 有没有ajax分页控件啊
没分了
------解决方案-------------------- public string Datagrid(string Cust_NO,string Order,int View,string name,string History,string id,int CurrPageNumber,string SALES)
{
Da.Project.CProject Dc=new Da.Project.CProject();
Dc.ds=Dpp.GetProject(Cust_NO,Order,View,name,History,SALES).ds;
//string Html =Cs.Datagrid(Dc.ds,id,name,CurrPageNumber);
string Html =toDatagrid(Dc.ds,id,name,CurrPageNumber);
return Html;
}
public string toDatagrid(DataSet ds,string id,string user,int CurrPageNumber)
{
User=user;
DataGrid dg = new DataGrid();
dg.ID=id;
dg.HeaderStyle.Height=System.Web.UI.WebControls.Unit.Parse ( "20px ");
dg.HeaderStyle.VerticalAlign=System.Web.UI.WebControls.VerticalAlign.Middle;
dg.HeaderStyle.BackColor=System.Drawing.Color.WhiteSmoke;
dg.Style.Add( "FONT-SIZE ", "10pt ");
dg.Style.Add( "Z-INDEX ", "0 "); //2007-4-15
if(id== "Forecast1 " )
{
dg.Style.Add( "LEFT ", "20px ");
}
else
{
dg.Style.Add( "LEFT ", "0 ");
}
dg.Style.Add( "CURSOR ", "hand ");
dg.Style.Add( "POSITION ", "absolute ");
dg.Style.Add( "tableLayout ", "fixed "); //2006-4-15
dg.Style.Add( "TOP ", "30px ");
dg.Style.Add( "BORDER-COLLAPSE ", "collapse ");
dg.Style.Add( "noWrap ", "true ");
dg.Style.Add( "overflow ", "scroll ");
dg.Style.Add( "border ", "1 ");
dg.Style[ "border-collapse "] = "collapse "; //2007-4-15
dg.Style.Add( "cellspacing ", "0 ");
//dg.BorderWidth=1;
//BorderColor= "Black " BorderWidth= "1px "
dg.Style.Add( "BorderColor ", "Black ");
dg.Style.Add( "BorderWidth ", "1px ");
dg.BorderColor=System.Drawing.Color.Gainsboro;
dg.ItemDataBound += new System.Web.UI.WebControls.DataGridItemEventHandler(this.DataGrid1_ItemDataBound);
dg.PageIndexChanged += new System.Web.UI.WebControls.DataGridPageChangedEventHandler(this.DataGrid1_PageIndexChanged);
dg.ItemCreated += new System.Web.UI.WebControls.DataGridItemEventHandler(this.DataGrid1_ItemCreated);
dg.DataSource =ds.Tables[ds.Tables.Count-1];
/*
dg.AllowPaging=true;
dg.PageSize=20;
dg.PagerStyle.Mode=PagerMode.NumericPages;
dg.CurrentPageIndex=CurrPageNumber-1;
*/
dg.DataBind();
//dg.CurrentPageIndex=CurrPageNumber;
//实例化一个HtmlTextWriter的类
System.Text.StringBuilder strb = new System.Text.StringBuilder();
System.IO.StringWriter sw = new System.IO.StringWriter( strb );
System.Web.UI.HtmlTextWriter htw = new System.Web.UI.HtmlTextWriter( sw );
//执行控件的render并输出到HtmlTextWriter里
dg.RenderControl( htw );
string Html = strb.ToString();
/*
Html=Html.Replace( " <a> ", " <a span onMouseover= "+Da.Cs_Comm.Chr(34)+ "this.style.Color= '#FFC080 ' "+Da.Cs_Comm.Chr(34)+ " onClick= FetchContents( ' ',Orderby,0,-1,this.innerHTML) onmouseout= "+Da.Cs_Comm.Chr(34)+ "this.style.Color= '#ffffff ' "+Da.Cs_Comm.Chr(34)+ "> ");
Html=Html.Replace( "