vendredi 6 janvier 2017

Checkbox turns into text input ASP.NET Core

I was attempting to make two checkboxes on an ASP.NET Core cshtml page like this:

    <div class="checkbox">
        <input asp-for="IsDesktop" />
        <label asp-for="IsDesktop">Desktop page</label>
    </div>

    <div class="checkbox">
        <input asp-for="IsPhone" />
        <label asp-for="IsPhone">Phone page</label>
    </div>

This code yields two different results! One type="text", and one type="checkbox" (see picture)

Both database columns are of type "bit" (either 1 or 0 for true or false).

What makes one of these inputs turn out as a text input?




Aucun commentaire:

Enregistrer un commentaire