@model IEnumerable @{ bool horizontal = ((bool)(ViewContext.RouteData.Values["horizontalLayout"] ?? false)); string wrapperClasses = horizontal ? "btn-group btn-group-sm btn-group-justified" : null; }
@Html.ActionLink("Home", "List", "Product", null, new { @class = horizontal ? "btn btn-default btn-sm" : "btn btn-block btn-default btn-lg" }) @foreach (var link in Model) { @Html.RouteLink(link, new { controller = "Product", action = "List", category = link, page = 1 }, new { @class = (horizontal ? "btn btn-default btn-sm" : "btn btn-block btn-default btn-lg") + (link == ViewBag.SelectedCategory ? " btn-primary" : "") }) }