How to make a dropdownlist from a seed model (populated table) and pass selected value to a string type variable in another model? -------------------------- class team {string teamID; string Name_team;} //model ************************* //seed in configuration file ************************* new ListTeam> {new Team{teamID="Architect";, Name_team="Architect"}, new Team{teamID="PM";, Name_team="Project_Management"}.ForEach(i => context.DBTeams.AddOrUpdate(i)); -------------------------- class User{ //model string name {get;set;} string team_of_user{get;set;} } -------------------------- class mainModel //model {[key] string mm {get;set;} User usr=new User(); Team tm=new Team(); } ------ VIEW @Html.DropDownListFor(m=>m.usr.team_of_user, new SelectList(...??));//what do i write here
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)