mvc 5 根据下拉框动态获取 其他值
选择名称后更新其他项controller里返回什么类型啊。$.post(url,{"gid":checkValue},function(data,status){$('#...
选择 名称 后更新其他项 controller 里返回什么类型啊。
$.post(url, { "gid": checkValue }, function (data, status) {
$('#GpeoCounts').val = model.groupmodel.GpeoCounts;
if (status == "success") {
alert("成功!");
//window.location.reload();
$('#query').window('refresh');
}
else {
alert("失败");
}
});
public ActionResult ChangeGroup()
{
int gid = Convert.ToInt32(Request["gid"].ToString());
//int gid = ViewBag.GID;
List<GroupInfoModels> gmList = gb.getGroupListModel();
// ViewData["gname"] = new SelectList(gmList, "GID", "Gname");
List<SelectListItem> gmselList = new List<SelectListItem>();
SelectListItem item0 = new SelectListItem();
item0.Value = "0";
item0.Text = "--请选择--";
gmselList.Add(item0);
foreach (GroupInfoModels d in gmList)
{
SelectListItem item = new SelectListItem();
item.Text = d.Gname;
item.Value = d.GID.ToString();
item.Selected = gid == d.GID ? true : false;
gmselList.Add(item);
}
ViewData["gname"] = gmselList;
GroupInfoModels group = gb.getGroupModelByID(gid);
GroupBookingModels gbms = new GroupBookingModels();
gbms.groupmodel = group;
return View(gbms);
}
controller 能接受到 返回这里不提示成功也不提示失败 跟不了断点 就大神解答~ 展开
$.post(url, { "gid": checkValue }, function (data, status) {
$('#GpeoCounts').val = model.groupmodel.GpeoCounts;
if (status == "success") {
alert("成功!");
//window.location.reload();
$('#query').window('refresh');
}
else {
alert("失败");
}
});
public ActionResult ChangeGroup()
{
int gid = Convert.ToInt32(Request["gid"].ToString());
//int gid = ViewBag.GID;
List<GroupInfoModels> gmList = gb.getGroupListModel();
// ViewData["gname"] = new SelectList(gmList, "GID", "Gname");
List<SelectListItem> gmselList = new List<SelectListItem>();
SelectListItem item0 = new SelectListItem();
item0.Value = "0";
item0.Text = "--请选择--";
gmselList.Add(item0);
foreach (GroupInfoModels d in gmList)
{
SelectListItem item = new SelectListItem();
item.Text = d.Gname;
item.Value = d.GID.ToString();
item.Selected = gid == d.GID ? true : false;
gmselList.Add(item);
}
ViewData["gname"] = gmselList;
GroupInfoModels group = gb.getGroupModelByID(gid);
GroupBookingModels gbms = new GroupBookingModels();
gbms.groupmodel = group;
return View(gbms);
}
controller 能接受到 返回这里不提示成功也不提示失败 跟不了断点 就大神解答~ 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询