通过url实现页面之间的信息传递
1.在Defaultaspx页面_Response.Redirect
string name = this.TextBox1.Text;
string sex = "先生";
if (RadioButton2.Checked)
{
sex = "女士";
}
Response.Redirect("~/welcome.aspx?Name="+name+"&Sex="+sex);
2在Welcome页面_Request.Params
string name = Request.Params["Name"];
string sex = Request.Params["Sex"];
Response.Write("欢迎"+name +sex+"!");
总结:Response.Redirect的参数类型为 string
在其中写入url
另一个页面通过 Request.Params请求参数