简体   繁体   中英

CSS and JS File Missing Error

Working on Orchard Asp.net MVC 3 Project.

If I look at the source code on the browser I see all the JS and CSS being referenced/imported, but when I click on the URL for some JS that is a part of MediaLibrary or Modules folder on my server, I get not found error.

Although the file does exist on the server as physically.

This is happening mostly in the Modules folder.

Any idea, why??

Thanks!!

You are missing a web.config allowing for the file to be served. Look at any web.config in the Scripts folder of any existing module for an example.

Something in your question sounds a little concerning however: you are talking about media library. It would be a very bad idea to serve script from the media library. That would be a huge security hazard. You should limit it to a well-defined Scripts folder in your module, that contains only script, and that can't be uploaded to.

External Javascript activity is highly restricted on local machines, especially with chrome and IE 8. Most probably that's causing the error. If that's the cause, I suggest you to include those external js files to your project to load locally or you can change the source path of the js to load from external host such as google host.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM