Resource location issue

Topics: General, Troubleshooting
Feb 12, 2013 at 4:19 PM
I had a really strange issue happen yesterday on one of my production servers that I'm hoping someone can help me prevent in the future.

I have a View in a custom module that makes a call to a JavaScript file in my theme using Script.Include("filename.js"). This has been working perfectly fine for months and months.

All of a sudden yesterday, the site decided that it wanted to load that file from the module's Script folder instead causing a Resource Not Found error that prevented a critical function on the site.

Recycling the application pool resolved the issue and the site is now looking for the resource in the proper location again.

Any ideas on what could possibly cause this to happen and possibly how to prevent it from happening again in the future? Is there a better way to reference scripts in the Theme so that the site won't try to look in the module's Script folder?

Any insight would be greatly appreciated...I was off work yesterday and had to remote in to resolve the issue after a flood of phone calls from users who couldn't run any reports. Thanks!
Feb 12, 2013 at 4:25 PM
May be a combination of and

In any case, the workaround is simple: us the full application-rooted path, e.g. Script.Include("~/Themes/YourThemeName/Scripts/filename.js")
Feb 12, 2013 at 4:43 PM
Gotcha...I'll do that. Thanks for the quick reply