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
3 answers

Passing parameter to @Url.Action based on jquery hasClass output

I am trying to pass an integer parameter to Url.Action based on hasClass output of jquery. something like below but is invalid syntax.
  • AKS
    • 1,279
    • 11
    • 27
  • 0
    votes
    0 answers

    MVC Url.Action and Routing Configuration Relation

    I would like to revise the questions here, my focus is on MVC Url.Action: I am testing on Url.Action in view http:// localhost:22334/Order/Index @Url.Action("Summary", "Order") When the route config is routes.MapRoute( name: "Order", …
    mintssoul
    • 51
    • 1
    • 10
    0
    votes
    0 answers
    0
    votes
    2 answers

    String attribute in Razor as a part of onclick confirmation

    I need a confirm window before calling the action specified in Url.Action. My code is: Where w is the…
    Margarit
    • 107
    • 9
    0
    votes
    1 answer

    RAZOR - how to pass data to controller using Url.Action?

    I have page which display a table and a DropDownList - which are not included in the form. When a user selects a value in the DropDownList - JavaSript puts the selected value in a text box named selectedCategory which is located in a…
    Zalek Bloom
    • 551
    • 6
    • 13
    0
    votes
    2 answers

    How to give user confirmation message before ActionLink based on validation

    I have the following link. On click, I'd like to check the item.primary_company field and if populated, give the user a warning and ask if they would like to continue. How can I do this?
    RememberME
    • 2,092
    • 4
    • 37
    • 62
    0
    votes
    1 answer

    Migrating MVC4 problems in Url.Action with jquery params

    I am migrating from MVC2 to MVC4 and I have a problem when I use the Url.Action function whith params from jquery. The generated url is wrong. Im using C# with Framework 4.5.1 This is my code: var doc =…
    James2707
    • 122
    • 1
    • 2
    • 13
    0
    votes
    3 answers

    Adding filename in url

    I want to customize route in ASP.NET MVC. With @Url.Action("ViewDoc", "Home", new { FileName = "ABC.pdf" }) and routes.MapRoute( name: "", url: "{controller}/{action}/{FileName}", defaults: new { …
    Nands
    • 379
    • 3
    • 19
    0
    votes
    1 answer

    Kendo UI Grid Pass parameter to action from cell data

    I am trying to figure out how to get the data from a cell of the row I have selected. I need it to be a parameter in my URL.Action. Is there a way to achieve this? If so, how? Below is the code. @(Html.Kendo().Grid(Model.dailyLogEventList) …
    jeffkenn
    • 201
    • 4
    • 16
    0
    votes
    1 answer

    In asp.net-mvc, How can I show a loading image while my other image is getting generated from Url.Action?

    I have the following code: " id="overlay" /> and it takes a little while for this to generate (as i am generating an image on the fly). How can i show a "Loading . ." image or message, while this is being…
    leora
    • 188,729
    • 360
    • 878
    • 1,366
    0
    votes
    2 answers

    Using Url.actions with optional parameters

    Just wondering if anyone can help me. I have an MVC project and in my view I'm using url.action to link to my action. My action can handle 3 optional parameters Category, SubCategory and a Name. But the problem is SubCategory could be Null so I…
    0
    votes
    2 answers

    Displaying Multiple Image Links instead of Text in WebGrid?

    I have a WebGrid definition and three links in a single column by using Html.ActionLink. But, when I do not use "LinkText" property, the applicantId property is passed as null value to the Controller. On the other hand, when just using LinkTexts…
    Jack
    • 1
    • 21
    • 118
    • 236
    0
    votes
    2 answers

    ASP.NET MVC How to create action links based on routing

    Like stackoverflow, you have domain/questions/{id}/{title} It doesn't matter what you actually send as title, if it's not the actual title of the question, it automatically does a permanent redirect 302 I think to the canonical url. This is all nice…
    Bart Calixto
    • 19,210
    • 11
    • 78
    • 114
    0
    votes
    1 answer

    Ommitting additional parameter variable name from Url.Action string

    I have a call from within a table as follows: td> I want this to return a URL of:…
    Jay
    • 3,012
    • 14
    • 48
    • 99
    0
    votes
    1 answer

    How to bind .Url(Url.Action()) property to toolbar in kendo ui grid(html)

    i have a grid developed using kendo ui and asp.net mvc4 razor.in there i have used the html syntax for kendo grid instead of asp.net mvc. this is the code of my grid
    sanzy
    • 805
    • 9
    • 18
    • 28
    1 2 3
    9
    10