Plaese找到我的打击代码,建议如何在下拉菜单中绑定收藏列表;
控制器
Public ActionResult Registation()
{
RegisrationModel register=new RegisterationModel();
register.Country=GetContryCode();
view(register);
}
型号:
public class RegistrationModel{
Dictionary<int,string> Country=new Dictionary<int,string>();
public Dictionaly<int,string> GetCountryCode()
{
County.Add(1,"India");
Country.Add(2,"Us");
so on.
}
}
RazorView:Registation.cshtml-&GT;你能不能建议如何在Razor视图中绑定Country属性?