A.aspx请求页面代码:
string suchtml="<meta content=\"China TENCENT\" name=\"TENCENT_ONLINE_PAYMENT\">\n"
+ "<script language=\"javascript\">\n"
+ "window.location.href='http://localhost/Query/B.aspx?&a=+a+&b=+b';\n"
+ "</script>";
string a = "china";
string b = "dns"
Response.Write(suchtml);
B.aspx接收显示页面代码:
Label1.Text = Request.QueryString["a"].ToString();
Label2.Text = Request.QueryString["b"].ToString();
按理论应该是没问题,但实际上是传不过去,显示的不是值.而是变量的名字a和b..
高手帮帮忙.看是不是我的url+参传值的方法不对??????
------解决方案--------------------------------------------------------
B.aspx?&a="+escape(a)+"&b="+escape(b)
------解决方案--------------------------------------------------------
Label1.Text = Server.UrlEncode(Request.QueryString["a"].ToString());
Label2.Text = Server.UrlEncode(Request.QueryString["b"].ToString());
------解决方案--------------------------------------------------------
获取带单引号的 url参数
要在获取页面加 <%@ Page
ValidateRequest="false"
------解决方案--------------------------------------------------------
打错了
+ "window.location.href='http://localhost/Query/B.aspx?&a=" +a+ "&b="+b+"';\n"
------解决方案--------------------------------------------------------
------解决方案--------------------------------------------------------