Using “data-toggle” with Html.ActionLink

You can’t. But there is a simple work-around. What you do is, replace the – with a _. During runtime it will get converted to a dash (-).
So;

Html.ActionLink("Delete", "Users", "Admin", new { item.UserId , strRole = strRole }, new { id = "cmdDelete", href="#myAlert",  data_toggle="modal" })

Leave a Comment