使用URL重写时如何在服务器上设置图像路径表单子文件夹(Global.Asax) [英] How Do I Set Image Path Form Sub Folder on server When Using Url Rewriting (Global.Asax)
本文介绍了使用URL重写时如何在服务器上设置图像路径表单子文件夹(Global.Asax)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好朋友
我想在我的购物项目中重新写一下我的成功,但我的图片没有显示在子文件夹中,例如:admin / ProductImages / img.jpg
我的代码
图片位置位于:admin / ProductImages / img.jpg
Hello Friends
I am trying to re write ule in my shopping project i successeded in that but my images are not showing from sub folder eg: admin/ProductImages/img.jpg
my code
image location is at :admin/ProductImages/img.jpg
<div>
<a href="../silver-and-fashion-jewellery/<%= Page.RouteData.Values["catname"]%>/<%#Eval("ItemCode")%>">
<img id="ProductImg" src='<%#Eval("ImagePath")%>' /></a>
Global.asax代码
Global.asax code
void Application_Start(object sender, EventArgs e)
{
RegisterRoutes(System.Web.Routing.RouteTable.Routes);
}
public static void RegisterRoutes(System.Web.Routing.RouteCollection routeCollection)
{
"silver_and_fashion_jewellery/Product-Category/{catname}", "~/ProductCategory.aspx");
routeCollection.MapPageRoute("RouteForProductCategory", "silver-and-fashion-jewellery/{catname}", "~/ProductCategory.aspx");
--------
----
}
你可以查看我的链接
http://silvauraa.myideaforest.com/银色和时尚珠宝/项链套装 [ ^ ]
先谢谢
you can check out my link
http://silvauraa.myideaforest.com/silver-and-fashion-jewellery/necklace-set[^]
Thanks in Advance
推荐答案
尝试添加〜/ admin / ProductImages / img.jpg希望它有效
try to add "~/admin/ProductImages/img.jpg" hope it works
这篇关于使用URL重写时如何在服务器上设置图像路径表单子文件夹(Global.Asax)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文