我有一个有两个Web窗体的asp.net项目。我想将listbox3(这是主页)的所有项目传递给统计页面中的文本框。我尝试下面的代码,但没有工作。如何将列表框的所有项目传递到另一个页面中的文本框? ASP.NET
主页:
protected void Button5_Click(object sender, EventArgs e)
{
Response.Redirect("Statistics.aspx?ListBox3");
}
统计数据页
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
TextBox3.Text = ListBox3.Items;
}
}
我想你想枚举的项目,像'foreach(var ListBox3.Items中的项目)TextBox3.Text = TextBox3 ==“”? TextBox3.Text + item.ToString():TextBox3.Text +“,”+ item.ToString();' –