【发布时间】:2015-03-20 18:11:57
【问题描述】:
我的 index.cshtml 中有一张图片
myApp/Images 文件夹内还有一个文件夹 Images
如果我访问
- http:/localhost/myApp 或
- http:/localhost/myApp/home/
工作正常。但是如果我使用
- http:/localhost/myApp/home/index
页面尝试在
中查找图片- http:/localhost/myApp/home/Images/send.png
那么我应该如何定义我的 src。
附加说明: 除了 index.cshtml,我还有一个 js 文件,其中将悬停效果添加到图像中。并且有同样的问题,这些选项都不起作用
$('#u3430_img').hover(
function () {
$(this).attr("src", "~/Images/send_hover.png");
},
function () {
$(this).attr("src", "Images/send.png");
}
);
【问题讨论】:
标签: html asp.net-mvc