Html.DropDownList-创新互联
后台
让客户满意是我们工作的目标,不断超越客户的期望值来自于我们对这个行业的热爱。我们立志把好的技术通过有效、简单的方式提供给客户,将通过不懈努力成为客户在信息化领域值得信任、有价值的长期合作伙伴,公司提供的服务项目有:空间域名、网页空间、营销软件、网站建设、滦平网站维护、网站推广。ListCountyitems = new List () { //new SelectListItem(){Text="--请选择--", Value="",Selected = false}, new SelectListItem(){Text="钦北区", Value="0",Selected = true}, new SelectListItem(){Text="钦南区", Value="1",Selected = false}, new SelectListItem(){Text="灵山县", Value="2",Selected = false}, new SelectListItem(){Text="浦北县", Value="3",Selected = false}, }; List Cityitems = new List () { //new SelectListItem(){Text="--请选择--", Value="",Selected = false}, new SelectListItem(){Text="钦州市", Value="0",Selected = true} }; List Provinceitems = new List () { //new SelectListItem(){Text="--请选择--", Value="",Selected = false}, new SelectListItem(){Text="广西省", Value="0",Selected = true} }; SelectList CountyList = new SelectList(Countyitems, "Value", "Text", 0); SelectList CityList = new SelectList(Cityitems, "Value", "Text", 0); SelectList ProvinceList = new SelectList(Provinceitems, "Value", "Text", 0); ViewData["County"] = CountyList; ViewData["City"] = CityList; ViewData["Province"] = ProvinceList;
前台
@Html.LabelFor(m => m.Province) @Html.DropDownList("Province", ViewData["Province"] as SelectList, new { style = "width:153px" }) @Html.ValidationMessageFor(m => m.Province) @Html.LabelFor(m => m.City) @*@Html.TextBoxFor(m => m.City)*@ @Html.DropDownList("City", ViewData["City"] as SelectList, new { style = "width:153px" }) @Html.ValidationMessageFor(m => m.City) @Html.LabelFor(m => m.County) @*@Html.TextBoxFor(m => m.County)*@ @Html.DropDownList("County", ViewData["County"] as SelectList, new { style = "width:153px" }) @Html.ValidationMessageFor(m => m.County)
另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。
网页题目:Html.DropDownList-创新互联
标题来源:http://ybzwz.com/article/ddgdpc.html