You could use a view model:
public class MyViewModel
{
public string Value { get; set; }
public IEnumerable<SelectListItem> { get; set; }
}
then you could have a controller which is populating this model and passing it to the view:
public ActionResult Index()
{
var model = new MyViewModel();
// TODO: you could load the values from your database here
model.Values = new[]
{
new SelectListItem { Value = "Objective", Text = "Objective" },
new SelectListItem { Value = "Subjective", Text = "Subjective" },
};
return View(model);
}
and then have a corresponding strongly typed view in which you would use the Html.DropDownListFor
helper:
@model MyViewModel
@using (Html.BeginForm())
{
@Html.DropDownListFor(x => x.Value, Model.Values, "Select any value");
<button type="submit">OK</button>
}
and finally you could have a corresponding controller action to which the form will be submitted and taking the view model as parameter:
[HttpPost]
public ActionResult Index(MyViewModel model)
{
// model.Value will contain the selected value here
...
}