您的位置:首页 > 编程语言 > ASP

ASP.NET 打开窗口的两程方法,

2012-08-17 16:04 495 查看
1/弹出新的窗口,并且窗口永远为其它窗口的最前方,像消息窗口一样,
2/弹出新的IE窗口,并无什么控制,(_self,在当前窗口打开新的网页,有点像转向,_blank,在当前窗口再弹出新的窗口页,scrollbars=yes滚动条设置

protected void btn_add_Click(object sender, EventArgs e)
{
if(CheckRight(FunName,ModuleRight.Insert))
{
string Script = "<script> OpenDialogEditDeliveryPage('EcnDetail.aspx?Random=" + System.DateTime.Now.ToString() + "')</script>";
ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "NewPage", Script, false);
}
}

JS code

<script type="text/javascript">
//这个调用前台执行是有顺序的
function OpenDialogEditDeliveryPage(ObjPage)
{
var GetValue = showModalDialog(ObjPage, '', 'dialogWidth:790px;dialogHeight:660px;dialogLeft:250;dialogTop:90;scroll:no;');

return true;
}
</script>

protected void btn_add_Click(object sender, EventArgs e)
{
if(CheckRight(FunName,ModuleRight.Insert))
{
ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "alert", " <script>window.open('EcnDetail.aspx?Random=" + System.DateTime.Now.ToString() + "','_blank', 'width=790, height=666, resizable=no, top=90, left=250'); </script>",
false);
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: