//这是WEBFORM1 private void Page_Load(object sender, System.EventArgs e)
{
if(!(Page.IsPostBack))
{
this.DataGrid1.DataSource=bangding("select * from biao");
this.DataGrid1.DataMember="biao";
this.DataGrid1.DataBind();
}
}
public DataSet bangding(string k)
{
    OleDbConnection cn=new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source="+Server.MapPath("db1.mdb"));
cn.Open();
OleDbCommand cd =new OleDbCommand(k,cn);
cd.ExecuteNonQuery();
OleDbDataAdapter da=new OleDbDataAdapter(cd);
DataSet ds=new DataSet();
da.Fill(ds,"biao");
    cn.Close();
    return ds;
} private void DataGrid1_PageIndexChanged(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e)
{
this.DataGrid1.CurrentPageIndex=e.NewPageIndex;
this.DataGrid1.DataSource=bangding("select * from biao");
this.DataGrid1.DataMember="biao";
this.DataGrid1.DataBind();
}
 
                                // 这是WEBFORM2
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
if(!this.IsPostBack)
{
this.Label1.Text=Request["ok"].ToString();
WebForm1 f1=new WebForm1();
 DataSet ds=new DataSet();
                ds=f1.bangding("select * from biao where b="+Label1.Text);
this.TextBox1. 这个TEXTBOX怎么绑定。
          
}
}
有没有什么介绍WEB控件的书呀。

解决方案 »

  1.   

    this.TextBox1.Text=ds.Table[0].Rows[0]["字段对应名"].ToString();// 这个TEXTBOX怎么绑定。
      

  2.   

    http://www.xia8.com/SoftList/Catalog_151_SoftTime_Desc_1.html
    http://coder.ylqh.com/share/
    http://www.senc.net/index.asp
    http://chs.gotdotnet.com/quickstart/aspplus/
    http://www.ibook8.com/Sorting/Catalog30/Sorting_Indate_Desc_1.html
      

  3.   

    form1中必须传递参数过去才可以,如
    Response.Redirect("WEBFORM2.aspx?ok=1")
    WEBFORM2中接受
    string ok=Request["ok"].ToString();//只有传递过来参数后才可以被接受
    this.Label1.Text=ok;