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

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

dataset - MPAndroidchart returning no chart Data available -

post - imageshack API cURL -