Jquery调用编辑按钮单击mvc网格

时间:2016-05-13 12:23:38

标签: jquery asp.net-mvc

下面是Grid列

 grid1.Column("", header: "Edit", format: @<text>@Html.ActionLink("Edit", "EditEmployee", "BootStrap", new { id = item.empId }, new { target = "_blank" })</text>)

如果点击上面的编辑按钮

,我想编写jquery函数在div下面打开
<div id="editView">
    @Html.Partial("~/Views/BootStrap/EditEmployee.cshtml",new EmployeeModel.Employee2())
</div>

2 个答案:

答案 0 :(得分:0)

试试这个:

grid1.Column("", header: "Edit", format: @<text>@Html.ActionLink("Edit", "EditEmployee", "BootStrap", new { id = item.empId }, new { target = "_blank", id = "myBtn" })</text>)

JS:

$("#myBtn").click(function(){
    $("#editView").show() //or open in dialog, or I don't know.
})

答案 1 :(得分:0)

试试这个

function EditEmployee()
  {
   $("#editView").show();
  }

Jquery功能

exec