G
Guest
I used the following code to transfer some web control data from Page1.aspx
to Page2.aspx.
It is successful to get the TextBox.Text over, but the DropDownList data
failed to appear in Page2. I wonder what went wrong?
Page1.aspx.cs
-----------------
public object Dept
{
get
{
return ddlDept.DataSource;
}
}
public string Rcp
{
get
{
return tbRcp.Text;
}
}
Page2.aspx.cs
-----------------
private void Page_Load(object sender, System.EventArgs e)
{
if (!Page.IsPostBack )
{
Page1 srcPage = (Page1) Context.Handler;
ddlDept.DataSource = srcPage.Dept;
ddlDept.DataBind();
tbRcp.Text = srcPage.Rcp;
}
}
Thanks in advance,
Ben
to Page2.aspx.
It is successful to get the TextBox.Text over, but the DropDownList data
failed to appear in Page2. I wonder what went wrong?
Page1.aspx.cs
-----------------
public object Dept
{
get
{
return ddlDept.DataSource;
}
}
public string Rcp
{
get
{
return tbRcp.Text;
}
}
Page2.aspx.cs
-----------------
private void Page_Load(object sender, System.EventArgs e)
{
if (!Page.IsPostBack )
{
Page1 srcPage = (Page1) Context.Handler;
ddlDept.DataSource = srcPage.Dept;
ddlDept.DataBind();
tbRcp.Text = srcPage.Rcp;
}
}
Thanks in advance,
Ben