Answer the question
In order to leave comments, you need to log in
ASP.NET doesn't see static files in Views/Home folder?
I am writing a project on ASP .NET MVC 4 In the View\Home folder there is an image bg.jpg but when you try to access it localhost:14066/Home/bg.jpg HTTP Error 404.0 - Not Found occurs and naturally this code does not work:
<style> .body { background-image: url("bg.jpg"); } </style>
Answer the question
In order to leave comments, you need to log in
The file is physically located in the /Views/Home/bg.jpg folder , but most likely this will not work. The /Views folder is for view files, partial views, and templates only. Normal (expected) processing of files in this folder should be disabled by default. The /Content
folder is for static files .
For script files, you can use the /Scripts folder .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question