如何将一个partialView传入一个View中,并调用View中的JS方法
的有关信息介绍如下:举例如下:
function showAddEmp() {
var dlg = $('#divAddEmp').dialog({
width: 800,
modal: true,
bgiframe: true,
title: '添加员工',
create: function () { //创建时候的方法
//$("#A_ID").numeral();
},
close: function () { //关闭时候的方法
//$("#divCreate").remove();
},
});
//dlg.parent().appendTo(jQuery("form:first"));
}
//
// GET: /Management/ManageEmployee
public ActionResult ManageEmployee()
{
return View();
}
//添加员工
//
// AJAX: /Management/AddEmployee/
public ActionResult AddEmployee()
{
return PartialView("_AddEmp");
}
//添加员工提交
//
// POST: /Management/AddEmployee/
[HttpPost]
public ActionResult AddEmployee(Employee employee)
{
if (ModelState.IsValid)
{
EmpBiz.addEmployee(employee);
return RedirectToAction("ManageEmployee");
}
return PartialView("_AddEmp");
}