I have found countless examples and posts about passing "code behind" variables to Javascript, but I'm wondering if there is a way to do the opposite.
In my view, I'm trying to dynamically create a Url using an ASP helper class and a variable from javascript. What I would like to do is something like:
var url = '@Url.Action("' + actionname + '", "controller")';
... where actionname is predetermined by some other logic. This won't work because I can't break up the inline code like that.
Anybody else tried to do something like this before or have any ideas?
Thanks!