What is the best way to create the same dropdownlist in mvc3??
as you can see in this link
Html JS example
I tried to do it like this
model:
public enum oporetor
{
greater_then = '>',
less_than = '<',
equal = '='
}
public oporetor getOp { get; set; }
}
view model:
@Html.DropDownListFor(model => model.getOp, new SelectList(Enum.GetValues(typeof(Fnx.Esb.ServiceMonitor.ViewModel.AdvanceSearchModel.oporetor))))
view:
@Html.EditorFor(x => x.AdvanceSearchModel)
I got a basic dropdownlist with greater_then, less_than,equal. How can I display a <,>,= in the dropdownlist?
or a better approach would be to prepare this data at your view model directly:
and then inside the view simply: