Applying style to action link in header strange behavior

Oct 3, 2011 at 10:46 PM


This should be relatively straightforward, but damn if I can find out why it is happening.

I'm adding an action link to the header.cshtml of a view

@if (User.IsInRole("admin"))
   @Html.ActionLink("next >", "Index", "Participant", htmlAttributes: new { @class = "abtn", style = "padding:0.3em 1em" })

without the 

htmlAttributes: new { @class = "abtn", style = "padding:0.3em 1em" })
the link works fine and redirects just fine
I want to add some styling to it and when I do it LOOKS the way I want it to look but the redirection falls apart. Instead of pointing to Participant view it now points to Length?11, for example.
Why is adding the class in this way breaking the pointer for the controller and action?
Oct 3, 2011 at 11:16 PM
Edited Oct 3, 2011 at 11:23 PM

This is a bug, apparently.

@if (User.IsInRole("admin"))
   <h2>@Mui.Go_to: @Html.ActionLink("next >", "Index", "Participant", new { }, new { @class = "abtn" })</h2>

works fine