我有一个带有图像的index.cshtml
< img id=”u3430_img” src=”Images/send.png”>
和myApp / 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");
}
);