Iam using MVC4, initially my dropdown displays the list of data, My javascript looks like,
$.each(data, function (value, key) {
var opt = "<option value=\"" + key + "\">" + value + "</option>";
$("#OwnerAgency").append(opt);
});
How do i set the selected default to be the blank option.
html:
<div class="SmallTopSpace">
<span class="LabelNormal">Primary Case Agency</span>
@Html.DropDownListFor(m => m.Agencies.AgencyKey, new SelectList(""), "", new { @class = "ImportDropDownMax", @id = "OwnerAgency", @onchange = "OwnerAgencyFunction();" })
</div>