When creating Blazor serverside select I cannot use Razor tag helper syntax?

<select asp-for="Dk" class="form-control"
        asp-items="@DKList">
    <option value="0">-- All --</option>
</select>

I have to use the old fashioned?

@using Microsoft.AspNetCore.Mvc.Rendering;

<select onchange=@DoStuff>
    <option value="0">-- All --</option>
    @foreach (var x in DKList)
    {
        <option value=@x.Value>@x.Text</option>
    }
</select>

@code {
      public SelectList DKList { get; set; }

Related posts

Recent Viewed