WORKS
<a href="@Url.Action("edit", "markets", new { id = 1 })"
data-rel="dialog" data-transition="pop" data-icon="gear" class="ui-btn-right">Edit</a>
DOES NOT WORK - WHY?
@Html.ActionLink("Edit", "edit", "markets", new { id = 1 }, new {@class="ui-btn-right", data-icon="gear"})
It seems you can't pass something like data-icon="gear" into htmlAttributes?
Suggestions?
This question is related to
asp.net-mvc
asp.net-mvc-2
actionlink
html.actionlink
Replace the desired hyphen with an underscore; it will automatically be rendered as a hyphen:
@Html.ActionLink("Edit", "edit", "markets",
new { id = 1 },
new {@class="ui-btn-right", data_icon="gear"})
becomes:
<form action="markets/Edit/1" class="ui-btn-right" data-icon="gear" .../>
@Html.ActionLink("display name", "action", "Contorller"
new { id = 1 },Html Attribute=new {Attribute1="value"})
Source: Stackoverflow.com