我使用 jQuery div 对话框来显示新的用户页面,如图所示
但是当我按下保存按钮时,新的用户页面正在与图片所示的同一页面中打开
标记:
<ul class="menu" style="margin-left:10px; background-color:transparent; width:100%;">
<li>
<input type="button" ID="btnNew" value="Add New" style="background-color:transparent; border:0;" runat="server" />
</li>
</ul>
代码隐藏:
btnNew.Attributes.Add("onClick", "ShowEntityEditor('NewUser.aspx','userID',0,'New User',300,650);")
JavaScript:(放置在母版页中)
function ShowEntityEditor(url, pname, entityID, txttitle, h, w) {
var _editWindowDiv;
_editWindowDiv = $("#_editWindowDiv").dialog({
autoOpen: false,
height: h,
width: w,
position: 'center',
title: txttitle
});
_editWindowDiv.empty();
_editWindowDiv.load(url + "?" + pname + "=" + entityID, function () {
$("#cancelButtoon").click(function () {
_editWindowDiv.dialog("close");
return false;
});
});
_editWindowDiv.dialog("open");
}