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
8
votes
2 answers

ASP.NET MVC: generating action link with custom html in it

How can I generate action link with custom html inside. Like following: New customer
alex.b
  • 4,547
  • 1
  • 31
  • 52
8
votes
4 answers

how to make html.actionlink without text but with image inside

it is simple html: <%-- Webseite auf Deutsch --%> i would like to make from them html.actionlink: <%= Html.ActionLink("", "ChangeCulture", "Account",…
r.r
  • 7,023
  • 28
  • 87
  • 129
8
votes
5 answers

how to insert image in html action link? asp.net mvc

I have navigation and many link on my webproject from html action links. They are ugly with underline. I would like to insert some image with name or play with styles of action link. Is it possible? How to do that? Thanks and take care, Ragims
r.r
  • 7,023
  • 28
  • 87
  • 129
8
votes
5 answers

Pass Dictionary of routeValues to ActionLink

All, Getting to grips with ASP.NET MVC. So far, so good, but this one is a little nuts. I have a view model that contains a dictionary of attributes for a hyperlink, used like this: menu = model variable Html.ActionLink(Html.Encode(menu.Name),…
Graham
  • 413
  • 3
  • 6
  • 10
8
votes
1 answer

How is OnSuccess measured for a ASP.NET MVC ActionLink?

I don't exactly understand how ASP.NETs ActionLinks work. I see that they have a event handler for OnSuccess and OnFailure, but I can't find anything that describes how success and failure is determined. I'm building an ASP.NET MVC application and…
Whozumommy
  • 3,203
  • 7
  • 29
  • 22
7
votes
2 answers

ASP MVC 3 RequireHttps attribute change all links to https

I have an ASP MVC 3 website that has a Feedback form and should require SSL. Now, I have an action called Feedback inside a controller called 'ContactUs' that is responsible for viewing and processing the feedback. When I used the [RequireHttps]…
Yousi
  • 811
  • 3
  • 12
  • 26
7
votes
8 answers

MVC make action link perform a submit

I am currently trying to make an html submit occur, but using the MVC helper method ActionLink as I do not want it to be a button, I want it to be an underlined link like the rest on my page. This is what I have currently <%= Html.ActionLink("Delete…
DMan
  • 111
  • 1
  • 1
  • 9
7
votes
3 answers

Adding rel and title to ASP.NET MVC Action Links

I decided primarily for SEO reasons to add the "rel" to my action link, but am not sure that the way I have gone about this is going to follow "best practices." I simply created a new Extension method as shown below. Is this the best way to go…
RSolberg
  • 26,821
  • 23
  • 116
  • 160
7
votes
1 answer

Why does RouteLink generate friendly URL while ActionLink does not?

I have a question regarding RouteLink vs. ActionLink. Consider the following route routes.MapRoute("Routename1", "{someEnum}/SpecificAction/{id}/{stringId}", new { controller = "MyController", id = (int?)null, stringId= (string)null, action…
Terje
  • 1,753
  • 10
  • 13
7
votes
9 answers

how do you add a NEW LINE character in the string portion of an ActionLink?

I'm building a Ajax.ActionLink in C# which starts: <%= Ajax.ActionLink("f lastname", ...more stuff and I'd like there to be a new line character between the words "f" and "lastname". How can I accomplish this? I thought the special character was…
Whozumommy
  • 3,203
  • 7
  • 29
  • 22
7
votes
1 answer

creating https actionlink

I am working asp.net mvc3. I have an action link like following: @Html.ActionLink("Yes", "Admin", "Foo", null, new { @class = "link" }) How can I modify this to create a link in https as oppose to http as I have set my controller action with…
amateur
  • 43,371
  • 65
  • 192
  • 320
7
votes
2 answers

Ajax.ActionLink vs Html.ActionLink + Jquery.Ajax call

I can call an asp.net mvc controller via Ajax.ActionLink("Get customers","GetCustomers","Customer"); I can do the same with the Html.ActionLink and a jquery ajax call. Where is the difference?
Pascal
  • 12,265
  • 25
  • 103
  • 195
6
votes
4 answers

How can I pass a Textboxes value to my Ajax.ActionLink?

In my ASP.NET MVC application I want a user to add a value into a textbox and then press my Ajax.ActionLink. I want to do something like this: Ajax.ActionLink("Go", "Action", "Controller", new { value = textbox1.value }) Or how else can I get this…
Whozumommy
  • 3,203
  • 7
  • 29
  • 22
6
votes
2 answers

Problems doing a proper HTTP Delete with Ajax.ActionLink

What i'm trying to do: Try to delete a record using a "proper" HTTP Delete. Controller Code: [HttpDelete] public void DeleteRun(int RunId) { repository.RemoveEntry(RunId); } Razor View: …
coding4fun
  • 8,038
  • 13
  • 58
  • 85
6
votes
1 answer

Passing parameters to MVC Ajax.ActionLink

How can I send the value of the TextBox as a parameter of the ActionLink? I need to use the Html.TextBoxFor <%= Html.TextBoxFor(m => m.SomeField)%> <%= Ajax.ActionLink("Link Text", "MyAction", "MyController", new { foo = "I need here the content of…
LastCyborg
  • 124
  • 1
  • 3
  • 6
1 2
3
40 41