I am trying to access a .js file in the views directory. I have an MVC application with /Views/Home/MyControl.ascx I have a js file /Views/Home/MyControl.js
I wish to reference the .js file and keep it with the control. I have tried the following entries in the routing, and none seem to work.
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("{file}.js");
routes.IgnoreRoute("{resource}.js/{*pathInfo}");
routes.IgnoreRoute("{controller}/{resource}.js/{*pathInfo}");
routes.IgnoreRoute("{*alljs}", new { alljs = @".*.js(/.*)?" });
Please help, please don t suggest adding the .js file to the scripts directory. I would like to make it work this way, or know why it cannot be done.
I would put the script into the page, only script debugging is broken in VS2010 B2.
Thanks Regards Craig.