本文介绍了如何打开弹出对话框单击以显示用户的详细信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
$('.detail-user').on("click", function () {
var tr = $(this).parents('tr:first');
var UserName = tr.find("#username").val();
$("#DivToAppendPartialView").load("/Admin/DetailUser?username=" + UserName, function () {
$("#DivToAppendPartialView").dialog({
modal: true,
width: 500,
height: 438,
title: "Detail User",
resizable: false
});
});
});
public PartialViewResult DetailUser(string Username)
{
var user = (from a in db.LoginMasters join b in db.UserDetails on a.UserID equals b.UserID where a.username == Username select new { a.username, a.status, b.CompanyName, b.Address }).FirstOrDefault();
UserDetail u = new UserDetail();
u.username = user.username;
u.status = user.status;
u.CompanyName = user.CompanyName;
u.Address = user.Address;
return PartialView(u);
}
推荐答案
这篇关于如何打开弹出对话框单击以显示用户的详细信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!