子窗口
js
function CloseWin(target) {
if (target) {
target.$('#w').window('close');
}
else {
parent.$('#w').window('close');
}
__doPostBack('S1', '');
}
html
<asp:LinkButton ID="S1" runat="server" OnClick="erer"></asp:LinkButton>
C#
protected void erer(object sender, EventArgs e)
{
this.Response.Write("<script>window.parent.document.all('F1').click();</script>");
}
父窗口
js
var winLists = new Array();
var winCount = 0;
function ShowWin(title, url, w, h) {
winCount++;
var winId = "w" + winCount.toString();
winLists[winLists] = { "id": winLists, "title": title };
$("<div id=\"" + winId + "\"></div>").appendTo("body");
$('#' + winId).window({
title: title,
top: 30,
width: w,
height: h,
modal: false,
shadow: true,
closed: true,
resizable: true,
content: '<iframe name="winfrm" id="winfrm" src="' + url + '" width="100%" height="100%" frameborder="0" scrolling="auto"></iframe>'
});
$('#' + winId).window('open');
}
function UploadPhoto() {
OpenWin("选择", ".a.aspx?,720, 450);
return false;
}
html
<asp:LinkButton ID="F1" runat="server" OnClick="F1_click"></asp:LinkButton>
updatepanel (其中用上面的linkbutton触发父页面的updatepanel 局部刷新)