I need help with the below error. It cant seem to find the WarehouseJavascript.js file which is outside the scripts folder.
Asked
Active
Viewed 626 times
-1
-
ya that doesnt help either... – who-aditya-nawandar Aug 13 '13 at 12:27
-
Possible solution: http://stackoverflow.com/questions/8062153/can-i-deploy-a-javascript-file-within-mvc-areas – Zafer Aug 13 '13 at 12:36
2 Answers
0
The URL /Views/Warehouse/WareHouseJavascript.js
is invalid, because you have to make request to controller instead of view.
So you should do following:
- Create controller for Warehouse it is not already exist (I cannot see it on your printscreen)
- Create action method for above view
- In action method return view WareHouseJavascript
- In link use
@Url.Action('Warehouse','Index')
assuming that controller name isWarehouse
nad action isIndex

Piotr Stapp
- 19,392
- 11
- 68
- 116
0
In your Views folder there should be a web.config file. In it, find the system.web/httpHandlers
section, and a static file handler line before the wildcard 404 handler line per the answer here: https://stackoverflow.com/a/6453724/426894
<httpHandlers>
<add path="*.js" verb="GET,HEAD" type="System.Web.StaticFileHandler" />
<add path="*" verb="*" type="System.Web.HttpNotFoundHandler"/>
</httpHandlers>