Unable to load CSS and images from the Content folder

I placed CSS and images in the Content folder.

Everything works fine in VS2010, but when I deployed to IIS 7.5, I cannot load CSS files and images from the Content folder. But I can download scripts from Content \ Scripts. However, if I put the files in the root folder, I can access.

I have done the following:

  • Verify that IIS has the role of static service content
  • Verify that the mapping for the static file exists
  • Add IIS_USR permission to the folder (application and both Content)
  • Be sure to use an absolute URL. @<link href = "@Url.Content("~/content/style.css")" rel="stylesheet" type = "text/css" media="screen"/>

These issues are not resolved.

What else can I do?

+4
source share
2 answers

It turned out that the Content site has another virtual folder.

We changed the name of the virtual path and the correctly loaded content.

0
source

try it

 <link href="@Url.Content("~/Content/styles.css")" rel="stylesheet" type="text/css" /> 
+2
source

All Articles