1

I am developing a website inASp.Net MVC 5. I want to test this in local IIS (version 8). But when i run / browse the published site, the CSS styling did not work. in my _layout.cshtml file i did not use bundles, instead i use direct link tags.

<link rel="stylesheet" href="~/assets/plugins/bootstrap/css/bootstrap.min.css">

any help.

Many thanks.

5
  • Has the .css file been copied across to the server when publishing? Commented Oct 28, 2014 at 9:18
  • yes the .css files has been copied in the destination folder. Commented Oct 28, 2014 at 9:23
  • what happens when you open the css file directly? Try open it in Chrome for example... Commented Oct 28, 2014 at 10:38
  • i just checked that the css files are present in their respective directories, but Chrome showed me empty file. for example i tried to open jquery.min.css and chrome just showed that there is no js code inside the file. Commented Oct 28, 2014 at 11:50
  • I think there is a problem with IIS. I put all the css and js files in assets folder which is present in main solution folder and then i linked each required file directly in my _Layout file as mentioned in above question. is it the problem? if yes then may i have to use default script and content folders and bundling? Commented Oct 28, 2014 at 11:53

2 Answers 2

2

I solved this problem by just checking the static content option in "Common HTTP Features" group of IIS configuration.

Sign up to request clarification or add additional context in comments.

Comments

0

The link below provide a more description on the resolution of this problem. Basically you will need to make sure that Static StaticFileModule is added to the StaticFile part within Handler Mappings in IIS

https://support.microsoft.com/en-hk/kb/2196177

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.