日期:2014-05-18  浏览次数:20500 次

请问C# 中想传两个参数给别的页面,该怎么写啊? 用+ 还是&, 菜鸟提问
原来传一个参数时,我是这么写的
C#中
  url="A.asp?file=" + File ; //File是个变量
  newNode.NavigateUrl =Url;

现在我想要传两个参数,该怎么写呢?
  url="A.asp?file="+ File + "&path=" + Path; //Path是个变量
这样写对吗?

  在a.ASP页面中我怎么才能分别得到参数file及path的值?
Sub window_onLoad()
  path= "<%=Request("path")%>" 
  file= "<%=Request("file")%>" 
end sub
行吗? 我这样写时得不到值



------解决方案--------------------
取值用
Request.QueryString[0].ToString();第一个参数
Request.QueryString[1].ToString();第二个参数
------解决方案--------------------
VBScript code
Sub window_onLoad() 
     path= " <%=Request("path")%>"  
     file= " <%=Request("file")%>"  
end sub

------解决方案--------------------
url="A.asp?file="+ File + "&path=" + Path; //Path是个变量 
这样写对吗? 
//对
------解决方案--------------------
Request.Params["参数一"].ToString();第一个参数
Request.Params["参数二"].ToString();第二个参数
------解决方案--------------------
Request.QueryString[path].ToString();
Request.QueryString[file].ToString();
可以得到这两个的值~! 
url="A.asp?file="+ File + "&path=" + Path; 这样写是对的阿!
------解决方案--------------------
url="A.asp?file="+ File + "&path=" + Path; //Path是个变量 
这样是对的
如果是post提交,取值如下:
Request.Form["file"];
Request.Form["path"];
get提交如下:

Request.QueryString["file"];
Request.QueryString["path"];