lundi 30 novembre 2020

Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer

I want to get Id of an entity which is an int type value; user will check/uncheck the checkbox, so I've converted that into boolean type. But I'm getting error. Here is the code-

 @for (int i = 0; i < Model.Count; i++)
    {
        <form asp-action="ReturnProduct" asp-route-id="@Model[i].HiddenPKVMId"
              onsubmit="return jQueryAjaxPost(this);">
                <div class="form-group">
                    <div class="col-md-6 offset-md-3">
                        <input type="checkbox" asp-for="@Convert.ToBoolean(Model[i].ProductVMName)" />
                    </div>
                </div>
            <input type="hidden" asp-for="@Model[i].HiddenPKVMId" />
        </form>
    }



Aucun commentaire:

Enregistrer un commentaire