Last post Jun 16, 2020 02:50 PM by bruce (sqlwork.com)
Jun 16, 2020 02:14 PM|aday|LINK
I am currently binding to @bind-Value= to get the selected Id but i would also like to bind and get the selected Text at the same time is there anyway of doing this. I tried @bind-CurrentValue but
that did not work
Jun 16, 2020 02:46 PM|XIII|LINK
please provide a code snippet when asking a question so we can better see what's going on/wrong.
Jun 16, 2020 02:50 PM|aday|LINK
<InputSelect class="ic-Input optionSelectionDropdowns" id="selDepartment" name="selDepartment" @bind-Value="Model.DepartmentId" @bind-CurrentValueAsString="Model.Department">
<option value="">-- NONE --</option>
@foreach (var dept in Departments)
if (!string.IsNullOrEmpty(Model.DepartmentId) && Model.DepartmentId.Equals(dept.Key, StringComparison.InvariantCultureIgnoreCase))
<option value='@dept.Key' selected>@dept.Value</option>
<inputselect class="ic-Input optionSelectionDropdowns" id="selDepartment" name="selDepartment" bind-value="Model.DepartmentId" bind-currentvalueasstring="Model.Department"></inputselect>
Jun 16, 2020 02:50 PM|bruce (sqlwork.com)|LINK
and lookup the text based on the select value. You can build the option list from blazor data.