Linq& amp; Bootstrap Modal Popup每次点击触发都应该继续控制器

时间:2014-04-12 08:49:12

标签: javascript jquery linq popup views

我在控制器中的行动:

public ActionResult Profile1(string ID)
{
string currentUserId = User.Identity.GetUserId();
var us = from u in db.Users
join s in db.Designations
on new { id = u.DesignationID } equals new { id = s.DesignationID }
where u.Id == ID
select new ViewEmployees
{
EmployeeCode = u.UserName,
EmployeeName = u.Name,
Father_Name = u.Father_Name,
DesignationName = s.DesignationName,
EmployeeType = u.EmployeeType,
Email = u.Email,
Mobile = u.Mobile
};
 return PartialView("Profile1", us);
}

My View我想在Modal弹出窗口中显示数据......

foreach(var item in Model)
{
 <td>
<a data-target ="#myModal" data-toggle="modal">@item.EmployeeName</a>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title" id="myModalLabel">Modal title</h4>
</div>
<div class="modal-body">
@Html.Action("Profile1", "Attendance", new {id=item.EmployeeID })
</div>
<div class="modal-footer">
<p>&copy; @DateTime.Now.Year - AL-KHIDMAT FOUNDATION</p>
</div>
</div>
</div>
</div>
</td>
}

当用户从员工列表中单击员工姓名时 它应显示该员工姓名被点击的个人资料......!

0 个答案:

没有答案