I have the Drop down list which is populated from a GetJSON call as shown below
VIEW
@{
var NoticeFilter =(X.Models.Y.Z.NoticesEntity) ViewData["NoticeFilter"];
}
<div class="form-group">
<label>Field Office</label>
<select data-bind="options: FieldOffice, value: selectedFieldOffice, optionsCaption:'Choose...', optionsValue:'FieldOfficeID', optionsText:'Name'">
@if(NoticeFilter!=null)
{
<option value="@NoticeFilter.FieldOfficeID" selected></option>
}
</select>
</div>
When I direct to this page and send data into the NoticeFilter I want the value in drop-down pre-selected with the value in Noticefilter among the other values .How do I achieve this
I was wondering if there is way in razor HTML where I can set a default value to Drop-Down after the data-binding from KO JS