I am putting some data as buttons which are limited to 3, and rest of the data in dropdown. So e.g if I have 7 types in data so 3 will be buttons and rest 4 will as dropdown options.
@if(Model.Rounds)
{
var url = Url.Action("Round", "Home", new { area = "Rounds" });
<div id="round">
<div class="btn-group">
@{int btnCount = 0;}
@foreach (var rt in Model.Rounds)
{
if (btnCount < 3)
{
<button type="button" class="btn btn-default" data-url="@url" data-type="@rt.Value">
@rt.Key
</button>
btnCount++;
}
else
{
<div class="controls">
<select class="form-control">
<option data-url="@url" data-type="@rt.Value">@rt.Key</option>
</select>
}
}
</div>
</div>
</div>
}
The problem is after 3 buttons, 4 seoarate dropdowns are coming instead of a single dropdown with 4 options. What am I doing wrong?