Issue Description:
Dropdownlist after selection not showing the selected text from list.
Here I am using MVC Razor syntax to generate dropdownlist box.
<div class="form-group">
@Html.LabelFor(m => m.Genre)
@Html.DropDownListFor(m => m.Genre,
new SelectList(Model.Genres, "Id", "Name"),
"---Select---", new { @class = "form-control" })
@Html.ValidationMessageFor(m => m.Genre)
</div>
The list is correctly populating but after selecting the option it's not showing in the dropdownlist box.
Note: when I submit the form the correct selected value is sent to action.
Steps checked:
It uses bootstrap form-control class and the color set is Black. Also rest of the field values are displayed which are inside same form.
Thanks in Advance..
update Solution:
I have defined some override for my form-control class for text spacing which caused the problem. I was thinking color was issue, but actually issue was with my text padding.
.form-control {
font-size: 17px;
/*padding: 20px 15px;*/ /*this statement caused issue*/
border-radius: 9px;
height:42px; /* I replaced with padding to height which solved issue.*/
}
I have defined some override for my form-control class for text spacing which caused the problem. I was thinking color was issue, but actually issue was with my text padding.
.form-control {
font-size: 17px;
/*padding: 20px 15px;*/ /*this statement caused issue*/
border-radius: 9px;
height:42px; /* I replaced with padding to height which solved issue.*/
}