I want to show that if data does not exist then the dropdown will work normally but when the data exist then the drop-down will be disabled. I tried read-only but it is also not working for dropdown while it is working for the textbox.
@if (TrimsDataForEdit != null)
{
<div class="form-group">
@Html.LabelFor(m => m.SeasonId, new { @class = "col-lg-4 control-label" })
<div class="col-lg-7">
@Html.DropDownListFor(m => m.SeasonId, ViewBag.SeasonDDList as SelectList, new { @class = "form-control custom-select-box", @readonly = "readonly" })
@Html.ValidationMessageFor(m => m.SeasonId, "", new { @class = "text-danger" })
</div>
<div class="col-lg-1">
<span class="required">*</span>
</div>
</div>
}
else
{
<div class="form-group">
@Html.LabelFor(m => m.SeasonId, new { @class = "col-lg-4 control-label" })
<div class="col-lg-7">
@Html.DropDownListFor(m => m.SeasonId, ViewBag.SeasonDDList as SelectList, new { @class = "form-control custom-select-box" })
@Html.ValidationMessageFor(m => m.SeasonId, "", new { @class = "text-danger" })
</div>
<div class="col-lg-1">
<span class="required">*</span>
</div>
</div>
}