My dropdownlist is absolutely fine until if surround it with an MVC if statement. It then becomes invisible, while the text around it is visible.
Before Adding If
<b>Central Hub</b> @(Html.Kendo().DropDownList() .Name("postcodeServiceExclusionsHubSelector") .HtmlAttributes(new { style = "width: 70px;" }) .DataTextField("DepotNumber") .DataValueField("DepotID") .BindTo(Model.CentralHubs) .OptionLabel("Select..."))After Adding MVC If Statement
@if (Model.CanSelectCentralHub){ @:<b>Central Hub</b> @: Html.Kendo().DropDownList() .Name("postcodeServiceExclusionsHubSelector") .HtmlAttributes(new { style = "width: 70px;" }) .DataTextField("DepotNumber") .DataValueField("DepotID") .BindTo(Model.CentralHubs) .OptionLabel("Select..."); @: }
