(1)、先自己写一个命名空间在ASPX.CS文件中的单元引用下面写
namespace study
{
/// <summary>
/// CIndex 的摘要说明。
/// </summary>
public class CIndex
{
public static string name="";
public CIndex()
{
}
}
}
(2)、在WEBFORM1中引用命名空间study然后写
study.CIndex.name=TextBox1.Text;
Response.Redirect("WebForm2.aspx");
(3)、在WEBFORM2中写
Response.Write("你输入的参数值是: "+CIndex.name);