mirror of
https://github.com/rudollee/LearningMVC.git
synced 2025-06-08 08:26:20 +00:00
18 lines
696 B
Plaintext
18 lines
696 B
Plaintext
@model IEnumerable<string>
|
|
|
|
@{
|
|
bool horizontal = ((bool)(ViewContext.RouteData.Values["horizontalLayout"] ?? false));
|
|
string wrapperClasses = horizontal ? "btn-group btn-group-sm btn-group-justified" : null;
|
|
}
|
|
|
|
<div class="@wrapperClasses">
|
|
@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" : "") })
|
|
}
|
|
</div>
|