protected void Button1_Click(object sender, EventArgse)
{
//stringstr=@"http://localhost:1042/WebSite6/Default13.aspx?"+Server.UrlEncode("Name=aaa&Pass=123");
//Response.Redirect(str);
//返回已编码的字符串
stringjia = Server.UrlEncode("Name=aaa&Pass=123");
//返回已解码的字符串
stringstr = Server.UrlDecode(jia);
Response.Write(jia);
Response.Write(str);
}
//问号传值 用于两个页面之间是紧挨着的两个页面 有先有后的两个页面 先页面发送后页面接受
//问号后面的值是成对出现 别名=值 或者 标示=值
//如果我们需要拿值 是通过别名或者标识名 拿值
//多个传值需要用&符号连接
//传值的内容不能超过1024个字节
Response.Redirect("Default2.aspx?Num="+this.TextBox1.Text+"&Num2="+this.TextBox2.Text);
还需要注意的是 & 之间不能有空格
//问号传值
Response.Redirect("Default6.aspx?Num="+this.TextBox1.Text+"&Num2="+this.TextBox2.Text);