后台代码: public class DropController : Controller { // GET: Drop public ActionResult Index() { List<Province> list = new List<Province> { new Province{ Id=1,name="山西省"}, new Province{ Id=1,name="广东省"}, new Province{ Id=1,name=…
一.单选DropDownList传值 1.添加界面的DropDownList显示值问题 (1)在方法内添加ViewData的方法: var ad = new UnitsRepository(); ViewData["datasourceid"] = new SelectList(ad.dsname(), "id", "dsname"); ViewData["showstyleid"] = new SelectList(ad.s…