Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to implement bootstrap in an actionlink

I would like to implement bootstrap in the following actionlink:

@Html.ActionLink("Create New", "DepartmentView", "Department", null, 
 new { @style="text-transform:capitalize;" })  
like image 607
Joseph Avatar asked Nov 12 '13 10:11

Joseph


People also ask

How do I add a class to ActionLink?

ActionLink("View Performances", "Details", "Productions", null, new {@class = "button"}) if you just want to add the class. Also, the "Productions" part of this element is not required.

How does HTML ActionLink work?

Html. ActionLink creates a hyperlink on a view page and the user clicks it to navigate to a new URL. It does not link to a view directly, rather it links to a controller's action.

What is difference between HTML ActionLink and URL action?

There is a difference. Html. ActionLink generates an <a href=".."></a> tag whereas Url. Action returns only an url.

How do I transfer my ActionLink model to my controller?

ActionLink is rendered as an HTML Anchor Tag (HyperLink) and hence it produces a GET request to the Controller's Action method which cannot be used to send Model data (object). Hence in order to pass (send) Model data (object) from View to Controller using @Html.


1 Answers

@Html.ActionLink("LinkText", "FooAction", "FooController", null, new { @class = "btn btn-info" })
like image 139
Francis Avatar answered Nov 01 '22 06:11

Francis