Is it possible to use T4MVC in an external js file?
I include a js file in my cshtml file
and in MyScript.js i have the following in a function
@Url.Action(MVC.MyController.MyAction())
but it never get compiled to its Action name (thought that runat server would do that trick but it didn't)
what am i missing? I am also using chirpy if there is something that it can do to help...
thanks
This is more of a general MVC question than T4MVC. T4MVC simplifies how you call @Url.Action, but whether you use T4MVC or not, you won't be able to have server code in a plain .js file.
However, there are some solutions around, like Using Inline C# inside Javascript File in MVC Framework