本文介绍了如何从mvc3中的下拉列表中获取价值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 public ActionResult bindddl() { List < CRBT_SongMaster > titlelist = new List < CRBT_SongMaster > (); var TitleLST = new List < string > (); var GenreQuery =来自z的dbcontext.CRBT_SongMaster orderby z.SongId select z.TitleAlbum; TitleLST.AddRange(GenreQuery.Distinct()); ViewBag.TitleList = new SelectList(TitleLST); return View(bindddl,titlelist); } 这是我上面的行动方法。 以下是我的查看页面.... 专辑列表 @Html.DropDownList(TitleList,----选择专辑标题----) 请帮帮我我将如何从此下拉列表中获取价值?解决方案 public ActionResult bindddl() { List<CRBT_SongMaster> titlelist = new List<CRBT_SongMaster>(); var TitleLST = new List<string>(); var GenreQuery = from z in dbcontext.CRBT_SongMaster orderby z.SongId select z.TitleAlbum; TitleLST.AddRange(GenreQuery.Distinct()); ViewBag.TitleList = new SelectList(TitleLST); return View("bindddl", titlelist); }This is my action method above. below is my view page....Album [email protected]("TitleList", "----Select Album Title----")please help me how will I get value from this dropdownlist ? 解决方案 这篇关于如何从mvc3中的下拉列表中获取价值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
09-17 23:31