9

I would like to implement bootstrap in the following actionlink:

@Html.ActionLink("Create New", "DepartmentView", "Department", null, 
 new { @style="text-transform:capitalize;" })  
CodeCaster
  • 147,647
  • 23
  • 218
  • 272
Joseph
  • 829
  • 4
  • 15
  • 27
  • What is "implement bootstrap in an actionlink"? What does this code do? What do you expect it to do? – CodeCaster Nov 12 '13 at 10:55
  • @CodeCaster i want to change the css of "Create new" link with icon and color. – Joseph Nov 12 '13 at 10:57
  • Do you mean you want to apply a CSS class to the action link? – CodeCaster Nov 12 '13 at 11:02
  • Yes, Sorry for my english @CodeCaster I'm not able to use #Html.Bootstrap. – Joseph Nov 12 '13 at 11:03
  • Then see for example [How can I add a class attribute via Html.BeginForm?](http://stackoverflow.com/questions/879266/how-can-i-add-a-class-attribute-via-html-beginform). Add a `@class` property to the `htmlAttributes` parameter. So change `new { @style=...` to `new { @class="yourClass", style=...`. – CodeCaster Nov 12 '13 at 11:05
  • oh yea ! Now i get it !! Thanks !! CodeCaster @Francis – Joseph Nov 12 '13 at 11:09

1 Answers1

36
@Html.ActionLink("LinkText", "FooAction", "FooController", null, new { @class = "btn btn-info" })
Francis
  • 1,214
  • 12
  • 19