Use Separate js File And use Url Helpers in it with ASP.NEt MVC 3 and Razor View Engine

前端 未结 6 971
太阳男子
太阳男子 2020-12-15 06:22

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

6条回答
  •  误落风尘
    2020-12-15 06:58

    You can use RazorJS for that purpose. It allows writing Razor-Style C# or VB.NET inside your JavaScript files. There is a short description available here.

提交回复
热议问题