Questions tagged [url.action]

In ASP.NET MVC the URLHelper provides a method called Action that generates a fully qualified URL to an action method by using the specified action name, controller name, route values, and protocol to use.

In ASP.NET MVC, Controllers and Views has a property called Url that exposes a URLHelper type, which help to create URL address.

The URLHelper provides a method called Action that generates a fully qualified URL to an action method by using the specified action name, controller name, route values, and protocol to use, for sample:

<a href="@Url.Action("Create", "Product", new { area = "Sales" })">New Product</a>

See de MSDN documentation.

143 questions
0
votes
1 answer

How to use a javascript variable in url.action with ASP.NET MVC WebForms view engine

I want to redirect the user to a url in a javascript function. editClick: function () { var myid = 1; location.href = '<%= Url.Action("ActionName", "ControllerName", new { id = myid})%>'; }; But 'myId' does not…
duyn9uyen
  • 9,585
  • 12
  • 43
  • 54
0
votes
2 answers

Use Razor in Jquery

I am writing AJAX call which looks as follow: