I ask a similar question here and Darin Dimitrov answer that we can\'t use Url helper like $.ajax({ url: \'@Url.Action(\"Index\")\', . . . in sepa
Darin Dimitrov
$.ajax({ url: \'@Url.Action(\"Index\")\', . . .
Take a look at Generating External JavaScript Files Using Partial Razor Views. In this blog post, I describe how you can make use of regular Razor views and a custom action filter to render external JavaScript files that can have Razor code in them.