我页面里有个asp:button 当它单击时我想实现处理一段代码后,原页面不变,弹出一个新面来展示内容,
相当于A标签,的target='_balank'但是不能用Response.Write("<script> window.open </script>");因为用它后会被阻止,,,所以我用了以下的方法:
function ForceWindow ()
{
this.r = document.documentElement;
this.f = document.createElement("FORM");
this.f.target = "_blank";
this.f.method = "post";
this.r.insertBefore(this.f, this.r.childNodes[0]);
}
ForceWindow.prototype.ShowOpen = function (sUrl)
{
this.f.action = sUrl;
this.f.submit();
}
当我调用ForceWindow.ShowOpen ()时让form提交,居然也被IE阻止,
请高手指点在asp.net应如何处理在新页面中打开啊,
相当于A标签,的target='_balank'但是不能用Response.Write("<script> window.open </script>");因为用它后会被阻止,,,所以我用了以下的方法:
function ForceWindow ()
{
this.r = document.documentElement;
this.f = document.createElement("FORM");
this.f.target = "_blank";
this.f.method = "post";
this.r.insertBefore(this.f, this.r.childNodes[0]);
}
ForceWindow.prototype.ShowOpen = function (sUrl)
{
this.f.action = sUrl;
this.f.submit();
}
当我调用ForceWindow.ShowOpen ()时让form提交,居然也被IE阻止,
请高手指点在asp.net应如何处理在新页面中打开啊,
一个显示.一个遮罩
没太明白,我想显示的是 <a 的target='_blank'>效果? 用Div不能实现吧,可以详细讲下吗?
可以用DIv,将你显示的内容通过 DIV显示。
你展示一个页面的内容,你新建form表单做什么。