Hi,
I'm new to MVC and the new paradigm hasn't clicked yet. I want to create a user control that is a simple dropdown and uses data from a database to populate its items. The dropdown would be useable in any view I chose. At this point I don't need the control to be data/table agnostic, I'd settle for making the user control strongly typed like a view.
The scenario I'm looking at currently is to use the SelectedIndexChanged event (or its equivalent in MVC 2) to populate a table of related data.
Here is the markup from the Home\Index.aspx page for the html helper I'm trying to use.
<%: Html.DropDownList("SalesTerritories", new SelectList(MvcAdventure.Models.SalesTerritory, "TerritoryID", "Name")) %>
The dropdown helper doesn't work because 'MvcAdventure.Models.SalesTerritory' is invalid in this context (as the runtime told me when it went to render the page).
thanks,
Mike