I need to generate a dynamic dropdown list in a partial view using ASP.NET MVC 2.
controller:
[HttpGet]
public ActionResult GetDestinationList()
{
JqGridClientRepository rep = new JqGridClientRepository();
IEnumerable<Client> clients = rep.GetClients();
var li = from s in clients
select new
{
Company = s.Company
};
return PartialView(li);
}
Below is the view i'm having currently and i need to bind the values to the select list returned by the controller.
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamic>" %>
<select>
<option value="1">One</option>
<option value="2">Two</option>
...
</select>