I want to know how can I override or set value for data-valmsg-for?
I have this partial view
  @model ANGS_SyncBook.Models.Transaction.JournalDetails
@{
    int i=ViewBag.i==null?0:ViewBag.i;
}
<tr scope="row">
    <td>
        @*<select id="selDocument" asp-for="Gla_Code" class="form-control form-control-sm" asp-items="@(new SelectList(ViewBag.ChartOfAccounts,"Gla_Code","Gla_Name"))"></select>*@
        @*<select id="selChartofAcc" asp-for="Gla_Code" class="form-control form-control-sm"></select>*@
        @Html.DropDownList("[" + i + "].Gla_Code", new SelectList(ViewBag.ChartOfAccounts, "Gla_Code", "Gla_Name"), new { @class = "form-control form-control-sm", @id= "[" + i + "].Gla_Code" })
        @Html.ValidationMessageFor(model => model.Gla_Code, null, new { @Name = "[" + i + "].Gla_Code" } )
    </td>
Sample output of partial view
I want to validate every field that is required but it is not working because the Id is dynamically created
Is there something like?
@Html.ValidationMessageFor(model => model.Gla_Code, null, new { @Name = "[" + i + "].Gla_Code", @data-valmsg-for="[" + i + "].Gla_Code" } )
