2012-12-29 66 views
0

我真的很抱歉提出這個問題。幾個小時我試圖解決一個問題。我是ASP.NET MVC的新手。我有一個css文件,其中我指的是拖曳圖像。這裏是代碼:圖片無法加載在asp.net mvc 4

.white 
{ 
    background-image: url("images/site/glyphicons-halflings-white.png"); 
} 
.normal 
{ 
    background-image: url("images/site/glyphicons-halflings.png"); 
} 

我也將這些圖像添加到Content\images\site文件夾。但它不加載圖像和CSS不起作用。我可以在螢火蟲中看到這些拖曳錯誤訊息:

NetworkError: 404 Not Found -http://localhost:38544/Content/images/site/glyphicons-halflings.png"

NetworkError: 404 Not Found -http://localhost:38544/Content/images/site/glyphicons-halflings-white.png"

任何幫助提前感謝。

+0

您確定沒有拼寫錯誤的文件名嗎?你的代碼看起來很好。 –

+0

這會讓我發瘋。我複製了文件名。 – Beginner

+0

這是IISExpress(或卡西尼,如果這就是你正在使用)本地發生?或者當你在IIS上部署應用程序? –

回答

3

404錯誤是一個非常強烈的跡象表明,您拼錯了圖像文件名在您的CSS或忘記實際複製指定文件夾中的圖像。