日期:2014-05-17  浏览次数:20352 次

超链接将一个文件路径传给另一个页面,路径中有特殊字符比如说"+"加号
超链接将一个文件路径传给另一个页面,路径中有特殊字符比如说"+"加号


我这个超链接是在后台拼接字符串的,然后给的页面。下面写的内容


 string filessss = "<a href=\"Down.aspx?path=<%=Server.HtmlEncode(" + path + ")%>\">" + dr[0].ToString() + "</a><br/>";




 string filessss = "<a href=\"Down.aspx?path=<%=Server.URLEncode(" + path + ")%>\">" + dr[0].ToString() + "</a><br/>";



试过多种方法 里面有加号的都 传过去的值都没有加号  
我用的接值方法string path2 = Request.QueryString["path"].ToString();
接过来看还带有<%=Server.URLEncode("。。。。。   而且加号也没有了。
我的传方法错在哪里,接值是不是也错了 ,直接写文件路径传加号也是不能传的

------解决方案--------------------
你的混搭也太强了
string filessss = "<a href=\"Down.aspx?path="+ Server.UrlEncode(path) +"\">" + dr[0].ToString() + "</a><br/>";


------解决方案--------------------
path=<%=Server.URLEncode(" + path + ")%>