html5 - Add class "active" to Actionlinks generated by loop in ASP.NET MVC5 -
i've written button group using actionlinks filter products. want add "active" class clicked button. how this?
<div class="btn-group" role="group" aria-label=""> @html.actionlink("all categories","index",0,new { @class = "btn btn-default" }) @foreach(var category in viewbag.allcategories) { @html.actionlink((string) category.name, "index",new { categoryid = category.categoryid}, new { @class="btn btn-default"}) } </div>
thanks!
Comments
Post a Comment