0

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-> 你能建议如何在 Razor 视图中绑定 Country 属性吗?

4

0 回答 0