方法一 Controller 部分代码: public ActionResult Modify(int id) { //3.1.1 检查id //3.1.2根据id查询数据 Models.Student stu = (from s in db.Students where s.Id == id select s).FirstOrDefault(); //方法一.查询班级数据,并 做成 下拉框 选项集合 //List<Models.Class> listClass = (from c in d
后台代码: 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=
// 获取下拉框所选下标 传入下拉框的id function getselectscheckitemindex (idStr) { let o = document.getElementById(idStr).options for (let i = 0; i < o.length; i++) { if (o[i].selected == true) return i } }
Combo Select 是一款友好的 jQuery 下拉框插件,在 PC 浏览器上它能模拟一个简单漂亮的下拉框,在 iPad 等移动设备上又能回退到原生样式.Combo Select 能够对选项进行检索过滤,同时支持键盘控制. 支持浏览器: Safari, Chrome, Firefox, Opera iOS, Android, IE Mobile Internet Explorer IE 8 and above 开源地址:http://www.oschina.net/p/combo-sele