Questions tagged [actionlink]

In ASP.NET MVC, the ActionLink method renders an element that links to an action method in a controller. Specifically, it returns an anchor element ( tag) that contains the virtual path of the specified action method (possibly with route parameters).

In ASP.NET MVC, the ActionLink method renders an element that links to an action method in a controller. Specifically, it returns an anchor element ( tag) that contains the virtual path of the specified action method (possibly with route parameters).

LinkExtensions.ActionLink Method
http://msdn.microsoft.com/en-us/library/system.web.mvc.html.linkextensions.actionlink.aspx

605 questions
3
votes
2 answers

ASP MVC ActionLink causes invalid URL

Using the standard route pattern {controller}/{action}/{code} and then a standard ActionLink in my view <%: ActionLink("Details", "Details", new { code = item.Code }) %> When the user has entered "N/A" as their code I see the following…
Peter Morris
  • 20,174
  • 9
  • 81
  • 146
3
votes
1 answer

MVC4 ActionLink without parameters points to current path

I have a MVC4 Index page that have the following links: @Html.ActionLink("FOO", "Index", "Mil", new { year = String.Empty, id = String.Empty }, null) @Html.ActionLink("BAR", "Index", "Euro", new { year = String.Empty, id = String.Empty }, null) But…
Mr Billy
  • 151
  • 1
  • 2
  • 13
3
votes
3 answers

How to add css class to Action link in MVC

I am creating MVC5 project.using Inspina theme I have using Entity framework its generated Code Like this Edit delete details Following Like this @Html.ActionLink("Edit", "Edit", new { id = item.ClientId }) | @Html.ActionLink("Details",…
thenna
  • 423
  • 1
  • 5
  • 26
3
votes
2 answers

ASP.NET MVC and Ajax slow?

I've just started out trying MVC 2 and Ajax, and I'm wondering if I'm doing something wrong, because I was under the impression that Ajax would make changes in a webpage very fast. The example I have is with the Ajax actionlink:
<%:…
Anders
  • 12,556
  • 24
  • 104
  • 151
3
votes
2 answers

Why is my MVC actionlink taking me to the URL with a Length querystring value?

There isn't really much I can do in the way of explanation on this one. Simply put, I'm trying to render this link: Register My ActionLink looks like this: @Html.ActionLink("Register",…
Ortund
  • 8,095
  • 18
  • 71
  • 139
3
votes
2 answers

Possible to write an Extension Method for ASP.NET's Html.ActionLink() method?

Right now, I'm trying to work around an IE6/7 bug which requires the wrapping of the closing tag with this IE specific comment to make some drop-down menu work: Unfortunately, I cannot inject this…
Pretzel
  • 8,141
  • 16
  • 59
  • 84
3
votes
1 answer

ASP.NET MVC4 - Different routing for 2 controllers with actionLinks

Okay, I've got this case where I have two controllers: HomeController MathController I want the routing for my HomeController to stay as default:{controller}/{action}/{id}. But I want to access the actions in the MathController with…
3
votes
1 answer

MVC actionlink posting List of complex type

I have an actionlink that on click im passing a List of objects to a controller action. Example: View: Html.ActionLink("TestLink", "TestMethod", "Test", Model.SampleList, null) TestController: public ActionResult TestMethod(List
user300956
3
votes
1 answer

MVC Action Link in partial view

I'm new to MVC, trying to work out how @Html.ActionLinks work in partial views. Background- here's the relevant portion of the solution Models PersonViewModel.cs Views Addresses AddressListPartial.cshmtl Person Details.cshtml I…
DLeh
  • 23,806
  • 16
  • 84
  • 128
3
votes
1 answer

Link to a different controller in a view

I am coding an MVC web application in C#. How do I call an action on a controller from a view, where the action is not in the controller that loaded the view? @Html.ActionLink("Edit", "Edit", new { id=item.BookID }) | @Html.ActionLink("Details",…
user2985419
  • 553
  • 3
  • 9
  • 23
3
votes
2 answers

Passing Value from Kendo DDL to ActionLink/ActionImage without submitting values

VS'12 KendoUI InternetApplication Template C# asp.net EF Code First I got 2 dropdownlist pages 1 page uses the DropDownList For Posting values to a ModelView the other is just returning by ID. Qeustion Basically i want to stay in the view with a DDL…
Don Thomas Boyle
  • 3,055
  • 3
  • 32
  • 54
3
votes
1 answer

Pass a parameter into partial view to use as query string name in action link?

I am trying to make this code a partial view to add alpha paging to my grids:
@foreach (var letter in…
SventoryMang
  • 10,275
  • 15
  • 70
  • 113
3
votes
1 answer

In MVC3, How can I pass multiple values to a querystring parameter by ActionLink?

In my MVC3 project I have a controller "Test" with this method for Index action Function Index(fields() As String) As ViewResult ... Then on the View I have a a multi-select drop down list @Html.ListBox("fields", New MultiSelectList(my_list,…
Max
  • 4,965
  • 17
  • 49
  • 64
3
votes
1 answer

Save changes on CheckBox change?

I have an MVC Index page that reflects a table in the DB. One of the columns is a boolean. I want to have a checkbox right in the index page, that when clicked, immediately calls an action that will save the new status on the spot without having to…
Shimmy Weitzhandler
  • 101,809
  • 122
  • 424
  • 632
3
votes
1 answer

FB Open Graph: why when my app posts an action on user's wall, action link related to the action is not shown on the post?

I have defined and got approved by the Facebook the following actions in my app: 1) Donate to 2) Share which have connected objects Video and Article. Both of the actions have linked action 'Donate to', i.e. when user donates in my app to some…
Vladimir Lebedev
  • 1,207
  • 1
  • 11
  • 25