重写url时不是有效的虚拟路径 [英] Not a valid virtual path when rewrite the url

查看:274
本文介绍了重写url时不是有效的虚拟路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的代码是



HttpContext.Current.RewritePath(URL_path.Replace(/ productlist.aspx?cid = a2GSpnDbruI =&cnm = EYEGLASSES,/ Code /default.aspx))





i我遇到这个例外:

http:/ localhost:5877 /Code/Code/default.aspx'不是有效的虚拟路径。



任何人都可以告诉我代码中的问题是什么

my code is

HttpContext.Current.RewritePath(URL_path.Replace("/productlist.aspx?cid=a2GSpnDbruI=&cnm=EYEGLASSES", "/Code/default.aspx"))


i am getting this exception:
http:/localhost:5877/Code/Code/default.aspx' is not a valid virtual path.

can anyone can tell what is the problem in my code

推荐答案

只需从你的地址中删除/ code ..就像..



HttpContext.Current.RewritePath(URL_path.Replace( /productlist.aspx?cid=a2GSpnDbruI=&cnm=EYEGLASSES,〜/ default.aspx))
just remove the /code from ur address.. like..

HttpContext.Current.RewritePath(URL_path.Replace("/productlist.aspx?cid=a2GSpnDbruI=&cnm=EYEGLASSES", "~/default.aspx"))


这篇关于重写url时不是有效的虚拟路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆