I don't know how your controller action and model look like but this definitely works:
Model:
public class LanguageModel
{
public string Language { get; set; }
public IEnumerable<SelectListItem> LanguageOptions
{
get
{
return new[]
{
new SelectListItem { Value = "en", Text = "English" },
new SelectListItem { Value = "fr", Text = "French" },
};
}
}
}
Controller:
public class HomeController : Controller
{
public ActionResult Index()
{
return View(new LanguageModel());
}
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Index(LanguageModel data)
{
return View(data);
}
}
View:
<% using (Html.BeginForm()) { %>
<%= Html.DropDownList("Language", Model.LanguageOptions) %>
<input type="submit" value="OK" />
<% } %>
<div><%= Html.Encode(Model.Language) %></div>
Of course if you are using ASP.NET MVC 2.0, the strongly typed DropDownListFor
helper is preferable.