Questions tagged [html.actionlink]

html.actionlink is an HTML Helper in ASP.NET MVC framework. It enables to render an HTML link by using HTML.ActionLink().

With MVC, HTML helpers are much like traditional ASP.NET Web Form controls.

Just like web form controls in ASP.NET, HTML helpers are used to modify HTML. But HTML helpers are more lightweight. Unlike Web Form controls, an HTML helper does not have an event model and a view state. MVC includes standard helpers for the most common types of HTML elements, like HTML links and HTML form elements.

285 questions
0
votes
1 answer

Update Partial view MVC4

I have this controller: public ActionResult PopulateTreeViewModel() { MainModelPopulate mainModelPopulate = new MainModelPopulate(); // populate model return View(mainModelPopulate); } That has a view like…
Daniele
  • 668
  • 2
  • 10
  • 25
0
votes
3 answers

Align some text between two html.actionlinks

I have been trying to place a "|" between two actionlinks but it just goes out of the place.Is there a way I can align them just like in plain html page. @Html.ActionLink(....) | @Html.ActionLink(....) but doesnt align properly.Am i missing some…
RelatedRhymes
  • 428
  • 6
  • 26
0
votes
2 answers

asp:Repeater and ActionLink

Am I able to use asp:Repeater and Html.ActionLink together for creating a dynamic menu? Or is there any other methods that I can use it? Note: I'm getting the menu list from SQL.
Kaan
  • 902
  • 2
  • 16
  • 38
0
votes
1 answer

Need some help understanding the usage of this Html.ActionLink()

I'm following the NerdDinner ASP.Net MVC tutorial and I have the following line of code: <%= Html.ActionLink("Edit Dinner", "Edit", new { id = Model.DinnerID}) %> | <%= Html.ActionLink("Delete Dinner", "Delete", new { id = Model.DinnerID }) %> …
Sergio Tapia
  • 40,006
  • 76
  • 183
  • 254
0
votes
1 answer

MVC Action Link Issue

I have come across what appears to be an inconsistency in MVC 5 regarding the Html.Actionlink. In different cshtml files I can use the same code, but the url target that is generated is different. For example, this line of…
ebick
  • 79
  • 10
0
votes
2 answers

Html.ActionLink syntax

The code below is supposed to print out the names of the genres created in the Model as a hyperlink to them in another page. What is the purpose of new { genre = genre.Name }? We already have the for loop executing code for each genre, where the…
Mike
  • 961
  • 6
  • 19
  • 43
0
votes
1 answer

Html.ActionLink doesn't work in IE6

<%= Html.ActionLink("Account Page", "Index", new { controller = "Account", culture = (string)Session[culture], client = (string)Session[Client], brand = (string)Session[Brand], storeid = (string)Session[Store] })%> This works in almost…
an.it.professional
  • 121
  • 1
  • 2
  • 10
0
votes
1 answer

How do I pass info to route values so I can redirect back after I login Asp.Net MVC

Here is my actionlink to my login page with route values as null, so now my controllers Login action gets a returnUrl value of null
  • @Html.ActionLink("Log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink"…
  • chuckd
    • 13,460
    • 29
    • 152
    • 331
    0
    votes
    1 answer

    Call jqXHR.Abort() from Html.ActionLink

    This is my action link: @Html.ActionLink("View Details", "Details", new { controller = "Patients", id = @Model.Payments.FirstOrDefault().RCMPatientID, acctHistoryRedirect = "acctInfo", defaultPaymentID = @Json.Encode(paymentID) }, new { target =…
    AtlasBowler
    • 267
    • 1
    • 8
    • 18
    0
    votes
    3 answers

    Can't embed jQuery to @Html.ActionLink()

    I have a small problem with the @Html.ActionLink tag. I want to change the background when clicking on it. But it doesn't work.
    • @Html.ActionLink("View Profile", "Profile", "User", null, new { id = "profile" })
    and the jQuery…
    user4090029
    0
    votes
    0 answers

    MVC how to pass the updated Model back to a controller through an Html.ActionLink

    So I have the following view in MVC4: @model ViewModel @section Sidebar {
      ...
    • @Html.ActionLink(@menuItem.Name, @menuItem.ActionName, @menuItem.ControllerName, @Model, new { id =…
    JaySym
    • 63
    • 1
    • 8
    0
    votes
    1 answer

    MVC4 - ActionLink to either Create() or, if already existing, Edit(Id)

    I would like an action link that says "set user default". There's a possibility the database does not already have the UserDetails stored for the user who clicks the link. If this is the case, I would like to direct the user to the Create view…
    0
    votes
    1 answer

    How to control the behavior of Html.ActionLink with MapRoute

    In MSVC4, what is the accepted method of generating links in the form /Controller/Action/parameter? I have this in an .ascx... <%=Html.ActionLink(linkText:=doc.DocumentName, _ actionName:="CommissionPayment", _ …
    0
    votes
    1 answer

    @html.actionlink renders wrong url

    I've just started to learn ASP.NET and I'm trying to create a simple navigation but somohow i get the wrong url. I've been looking for anwsers all over the place but most are about more complex url. I'm using this for my navigation
    GleDel
    • 471
    • 5
    • 8
    0
    votes
    2 answers

    Adding html.actionLink to Jquery Datatable

    want to add HTML.actionlink to Jquery Datatable. Am wokrking on this existing site made by someone else. For adding data they used Jquery Datatable with is new to me. This is the data table: this.oUserList = $('#UserList').dataTable({ …
    m ali
    • 626
    • 2
    • 11
    • 31