Getting rid of hardcoded strings in JavaScript with ASP.NET MVC
We have a few problems in a project I am working on, where we have a lot of JavaScript files, where we have hardcoded URLs to controller actions. Hardcoded URLs are proned to mistyping Hardcoded URLs in JavaScript scripts will cause a breakage if the related controller or action's name is changed Tools like ReSharper (to my knowledge) can't statically analyse it's way to saying the an action is not used, if the URLs pointing to it are hardcoded. Question(s) How can we avoid using hardcoded URLs in JavaScript ? - are there any existing frameworks out there that could solve this problem ? Look