日期:2014-05-18 浏览次数:20447 次
public ActionResult Index() { return View(); } [HttpPost] public ActionResult Index(string picklist1) { return View(); }
------解决方案--------------------
MVC3/MVC4
有mvc4?
------解决方案--------------------
------解决方案--------------------
[NonAction] private void PopulateResourcesDropDownList(int? selectedValue = null) { ViewBag.ResourceID = new SelectList(unitOfWork.ResourceRepository.GetAll().Select(r => new { ID = r.ID, Name = r.Name + "(" + (r.Comment ?? "无") + ")" }), "ID", "Name", selectedValue); }
------解决方案--------------------
http://developer.51cto.com/art/200910/159507.htm
------解决方案--------------------
MVC4出来了吗?
OUT了的说呀!!
------解决方案--------------------
无刷新的方式,要刷新可用一楼的方法。
function LoadInfo() { var _this = this; var aj = 1; var postData = {}; postData["picklist1"] = $('#picklist1').attr('value'); if (aj == 1) { aj = 0; $.ajax({ type: "post", url: "/Controller/Action, //控制器名/操作名(返回jsonResult) dataType: 'json', data: postData, success: function (x) { $('#picklist2').empty(); if (x != null) { if (x != null) { var Data=''; for(var i=0;i<x.length;i++) { Data += '<option value=' + x[i].value + '>' + x[i].key + '</option>'; } $("#p