Generating an action URL in JavaScript for ASP.NET MVC

前端 未结 9 1157
梦毁少年i
梦毁少年i 2020-12-09 09:52

I\'m trying to redirect to another page by calling an action in controller with a specific parameter. I\'m trying to use this line:

window.open(\'<%= Url.         


        
9条回答
  •  孤街浪徒
    2020-12-09 10:08

    One more thing that can be done, no so clean i guess:

    var url = "@Url.RouteUrl(new { area = string.Empty, controller = "Survey", action = "Report" })";
    var fullUrl = url  + '?id=' + selectedRow;
    

提交回复
热议问题