public ActionResult Register()
{
List<T_User> list = new List<T_User>();
List<T_User> li = Session["User"] as List<T_User>;
IEnumerable<SelectListItem> ddlItemCountry = from o in db.Fetch<T_CityDate>("Select distinct Country from [T_CityDate] ")
select new SelectListItem
{
//Value = o.ID.ToString(),
Text = o.Country
};
IEnumerable<SelectListItem> ddlItemProvince = from o in db.Fetch<T_CityDate>("Select distinct Country, Province from [T_CityDate] ")
select new SelectListItem
{
//Value = o.ID.ToString(),
Text = o.Province
};
IEnumerable<SelectListItem> ddlItemCity = from o in db.Fetch<T_CityDate>("Select distinct Province, City from [T_CityDate] ")
select new SelectListItem
{
//Value = o.ID.ToString(),
Text = o.City
};
ViewBag.Country = ddlItemCountry;
ViewBag.Province = ddlItemProvince;
ViewBag.City = ddlItemCity;
return View();
//return View();
}
-------------------------
初学。所以请教改如何编写,才可以实现 国家,省,城市 三个选项中联动改变