9

I would like to implement bootstrap in the following actionlink:

@Html.ActionLink("Create New", "DepartmentView", "Department", null, 
 new { @style="text-transform:capitalize;" })  
6
  • What is "implement bootstrap in an actionlink"? What does this code do? What do you expect it to do?
    – CodeCaster
    Nov 12, 2013 at 10:55
  • @CodeCaster i want to change the css of "Create new" link with icon and color.
    – Joseph
    Nov 12, 2013 at 10:57
  • Do you mean you want to apply a CSS class to the action link?
    – CodeCaster
    Nov 12, 2013 at 11:02
  • Yes, Sorry for my english @CodeCaster I'm not able to use #Html.Bootstrap.
    – Joseph
    Nov 12, 2013 at 11:03
  • Then see for example 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, 2013 at 11:05

1 Answer 1

36
@Html.ActionLink("LinkText", "FooAction", "FooController", null, new { @class = "btn btn-info" })
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.