日期:2014-05-20  浏览次数:20483 次

UrlRewriter地址转换后,相对路径的问题
虚拟地址:localhost/Category12/34.aspx
真实地址:localhost/news.aspx?classid=12&newsid=34
图片本来的是在站点根目录下的目录images中,
但结果图片的地址都指向了:localhost/Category12/images,
所以图片的地址都错误了.
难道只能使用根路径?


------解决方案--------------------
<img src= "/images ">

我都是这么做的。
------解决方案--------------------
这么写也是挺个方便的呀,没有什么坏处吧?
------解决方案--------------------
../images
------解决方案--------------------
<img src= "~/images/mu.gif ">
这样呢
------解决方案--------------------
不行