If this is ASP.NET MVC 3:
<%= Html.RadioButton(
"defaultRadioButton",
d.Link,
d.IsDefault,
new {
data_link = d.Link
}
)%>
and the underscore will be automatically converted to dash by helper.
In previous versions of MVC, an ugly hack may be launched:
<%= Html.RadioButton(
"defaultRadioButton",
d.Link,
d.IsDefault,
new Dictionary<string, object> {
{ "data-link", d.Link }
}
) %>
source
share