Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net mvc asp.net mvc 4中未加载映像_Asp.net Mvc_Asp.net Mvc 4 - Fatal编程技术网

Asp.net mvc asp.net mvc 4中未加载映像

Asp.net mvc asp.net mvc 4中未加载映像,asp.net-mvc,asp.net-mvc-4,Asp.net Mvc,Asp.net Mvc 4,我真的很抱歉问这个问题。我花了几个小时才解决一个问题。我是ASP.NETMVC新手。我有一个css文件,其中引用了两个图像。代码如下: .white { background-image: url("images/site/glyphicons-halflings-white.png"); } .normal { background-image: url("images/site/glyphicons-halflings.png"); }

我真的很抱歉问这个问题。我花了几个小时才解决一个问题。我是ASP.NETMVC新手。我有一个css文件,其中引用了两个图像。代码如下:

.white
{
    background-image: url("images/site/glyphicons-halflings-white.png");
}
.normal
{
    background-image: url("images/site/glyphicons-halflings.png");
}
我还将这些图像添加到
Content\images\site
文件夹中。但是它不加载图像,css也不起作用。我可以在firebug中看到以下两条错误消息:

网络错误:找不到404-http://localhost:38544/Content/images/site/glyphicons-半身人.png“

网络错误:找不到404-http://localhost:38544/Content/images/site/glyphicons-半身人白色.png“


任何帮助都将提前得到感谢。

404错误非常强烈地表明您在CSS中拼错了图像文件名或忘记在指定文件夹中实际复制图像。

404错误非常强烈地表明您在CSS中拼错了图像文件名或忘记在CSS中实际复制图像指定的文件夹。

您确定没有拼错文件名吗?你的代码看起来很好,这会让我发疯的。我复制了文件名。这是在IISExpress(或Cassini,如果你正在使用的话)本地发生的吗?或者在IIS上部署应用程序时?看不到任何错误。唯一可能的原因是:1。拼写错误的文件名和/或路径以及2。文件在指定位置不存在。您是对的。拼写错误你确定没有拼错文件名吗?你的代码看起来很好,这会让我发疯的。我复制了文件名。这是在IISExpress(或Cassini,如果你正在使用的话)本地发生的吗?或者在IIS上部署应用程序时?看不到任何错误。唯一可能的原因是:1。拼写错误的文件名和/或路径以及2。文件在指定位置不存在。您是对的。错发