asp.net点击一个input按钮·弹出一个页面·

xugan666 2011-08-18 03:11:08
点击父页面的input button的时候弹出一个子页面,子页面居中对齐·然后里面有几个文本框,我点击保存的时候,可以进行后台交互,不管添加成功与否,这个页面都不关闭,直接再弹出一个提示框,domo

xugan1122@qq.com。多谢·
...全文
623 16 打赏 收藏 转发到动态 举报
写回复
用AI写文章
16 条回复
切换为时间正序
请发表友善的回复…
发表回复
xugan666 2011-08-19
  • 打赏
  • 举报
回复
额,最后我还是用jq做出效果了····
happytonice 2011-08-18
  • 打赏
  • 举报
回复
[Quote=引用 13 楼 hexytxl 的回复:]
HTML code

function sAlert(str) {
var msgw, msgh, bordercolor;
msgw = 400; //提示窗口的宽度
msgh = 100; //提示窗口的高度
titleheight = 25 //提示窗口标题高度
……
[/Quote]

这个超好!

likevs 2011-08-18
  • 打赏
  • 举报
回复
AsyncBox

一款广西南宁玩家写出来的JS插件,还不错
赢在执行 2011-08-18
  • 打赏
  • 举报
回复

function sAlert(str) {
var msgw, msgh, bordercolor;
msgw = 400; //提示窗口的宽度
msgh = 100; //提示窗口的高度
titleheight = 25 //提示窗口标题高度
bordercolor = "#c51100"; //提示窗口的边框颜色
titlecolor = "#c51100"; //提示窗口的标题颜色

var sWidth, sHeight;
sWidth = screen.width;
sHeight = screen.height;

var bgObj = document.createElement("div");
bgObj.setAttribute('id', 'bgDiv');
bgObj.style.position = "absolute";
bgObj.style.top = "0";
bgObj.style.background = "#cccccc";
bgObj.style.filter = "progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75";
bgObj.style.opacity = "0.6";
bgObj.style.left = "0";
bgObj.style.width = sWidth + "px";
bgObj.style.height = sHeight + "px";
bgObj.style.zIndex = "10000";
document.body.appendChild(bgObj);

var msgObj = document.createElement("div")
msgObj.setAttribute("id", "msgDiv");
msgObj.setAttribute("align", "center");
msgObj.style.background = "white";
msgObj.style.border = "1px solid " + bordercolor;
msgObj.style.position = "absolute";
msgObj.style.left = "50%";
msgObj.style.top = "50%";
msgObj.style.font = "12px/1.6em Verdana, Geneva, Arial, Helvetica, sans-serif";
msgObj.style.marginLeft = "-225px";
msgObj.style.marginTop = -75 + document.documentElement.scrollTop + "px";
msgObj.style.width = msgw + "px";
msgObj.style.height = msgh + "px";
msgObj.style.textAlign = "center";
msgObj.style.lineHeight = "25px";
msgObj.style.zIndex = "10001";

var title = document.createElement("h4");
title.setAttribute("id", "msgTitle");
title.setAttribute("align", "right");
title.style.margin = "0";
title.style.padding = "3px";
title.style.background = bordercolor;
title.style.filter = "progid:DXImageTransform.Microsoft.Alpha(startX=20, startY=20, finishX=100, finishY=100,style=1,opacity=75,finishOpacity=100);";
title.style.opacity = "0.75";
title.style.border = "1px solid " + bordercolor;
title.style.height = "18px";
title.style.font = "12px Verdana, Geneva, Arial, Helvetica, sans-serif";
title.style.color = "white";
title.style.cursor = "pointer";
title.innerHTML = "关闭";
title.onclick = function () {
document.body.removeChild(bgObj);
document.getElementById("msgDiv").removeChild(title);
document.body.removeChild(msgObj);
}
document.body.appendChild(msgObj);
document.getElementById("msgDiv").appendChild(title);
var txt = document.createElement("p");
txt.style.margin = "1em 0"
txt.setAttribute("id", "msgTxt");
txt.innerHTML = str;
document.getElementById("msgDiv").appendChild(txt);
}
</script>


<input type="button" value="点击这里" onclick="sAlert('test弹窗效果');" />
自由_ 2011-08-18
  • 打赏
  • 举报
回复
[Quote=引用 7 楼 wangyu19820830 的回复:]

建议采用Ajax,如果用window.open,用户的浏览器不一定能弹出来的。
[/Quote]
+1
open最好不要用
xzy19850320 2011-08-18
  • 打赏
  • 举报
回复
绑定个事件执行
window.open(url, "1", "resizable=yes,toolbar=no,statusbar=no,menubar=no,location=no,scrollbars=yes,titlebar=no,width:900,height:700");
chen_ya_ping 2011-08-18
  • 打赏
  • 举报
回复
jquery dialog绝对的适合你
  • 打赏
  • 举报
回复
点击A页面的按钮,弹出一个B窗口,选择B窗口中的选项,点击确定时将值赋给A窗口的文本框。

A页面:有一个文本框TB_ENTERPRISE_CODE和一个按钮Btn_Select
<a onclick="window.open('/BaseInfo/EnterpriseTreePage.aspx', 'newwindow', 'height=400, width=400, top=0,toolbar=no, menubar=no, scrollbars=auto, resizable=yes,location=no, status=no')">Btn_Select</a>

B页面:点击确定按钮
ClientScript.RegisterStartupScript(this.GetType(),Guid.NewGuid().ToString(),
"<script>window.opener.document.getElementById('ctl00_pageContent_TB_ENTERPRISE_CODE').value='" + this.TreeView1.SelectedNode.Value + "';window.opener.document.getElementById('ctl00_pageContent_TB_ENTERPRISE_NAME').value='" + this.TreeView1.SelectedNode.Text + "';window.close();</script>");
weike021996 2011-08-18
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 slife890809 的回复:]
引用 2 楼 zzc_king 的回复:

window.open(url, "1", "resizable=yes,toolbar=no,statusbar=no,menubar=no,location=no,scrollbars=yes,titlebar=no,width:900,height:700");
+1
[/Quote]+1
拐点 2011-08-18
  • 打赏
  • 举报
回复
建议采用Ajax,如果用window.open,用户的浏览器不一定能弹出来的。
梦纷飞舞 2011-08-18
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 zzc_king 的回复:]

window.open(url, "1", "resizable=yes,toolbar=no,statusbar=no,menubar=no,location=no,scrollbars=yes,titlebar=no,width:900,height:700");
[/Quote]+1
我TM真的是猪 2011-08-18
  • 打赏
  • 举报
回复
windows.open("");
小脩 2011-08-18
  • 打赏
  • 举报
回复
zzc_king 2011-08-18
  • 打赏
  • 举报
回复
window.open(url, "1", "resizable=yes,toolbar=no,statusbar=no,menubar=no,location=no,scrollbars=yes,titlebar=no,width:900,height:700");
子夜__ 2011-08-18
  • 打赏
  • 举报
回复
参考
可以弹出一个页面。

62,039

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧