vtfuture / BForms

Bootstrap Forms for ASP.NET MVC
MIT License
62 stars 33 forks source link

Problem with ActionLink on Toolbar #231

Closed ewelinaprus closed 9 years ago

ewelinaprus commented 9 years ago

Hello, I would like to add action link to my toolbar according to docs:

   ca.AddActionLink().Action(Url.Action("MyAction", "MyController"));

But I got message in VS that BsToolbarActionsFactory does not contain definition for AddActionLink. Am I missing something?

With my best, Ewelina

cristipufu commented 9 years ago

Hello @ewelinaprus,

AddActionLink() is used with button groups.

In order to achieve what you want, you should do it like this:

ca.Add("cssClass").Text("Action link title").Action(Url.Action("MyAction", "MyController"));

ewelinaprus commented 9 years ago

Awesome, thanks! :)

May I suggest update the doc? I mean that part:

"You can also use a button of type ActionLink that will redirect the user 
  to the specified controller action.

  @(Html.BsToolbarFor(x => x.Toolbar)
     .ConfigureActions(ca =>
     {
         ca.AddActionLink().Action(Url.Action("YourAction", "YourController"));
     })".

Thanks a lot! Ewelina

cristipufu commented 9 years ago

Done, thanks.