您的位置:首页 > 其它

软件测试入门:从这里开始

2012-03-10 09:24 232 查看
    protected void Button1_Click(object sender, EventArgs e) //A页面
    {
        //Response对象的Redirect方法重定向的功能.并向重定向的url传递参数
        string name = txtname.Text.Trim();
        string sex = "先生";
        if (RadioButton2.Checked)
            sex = "小姐";
        Response.Redirect("Welcome.aspx?Name="+name+"&Sex="+sex);
    }

 

 

public partial class Welcome : System.Web.UI.Page //B页面
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string name=Request .Params["Name"];
        string sex=Request .Params["Sex"];
        Response.Write("欢迎"+name+sex+"!");
    }
}

 

 

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: