避免弹出窗口阻止JavaScript
问题描述:
我正在使用
I am using
Response.Write("<script>window.open('WebForm1.aspx')</script>")
但是我的页面没有打开,显示弹出窗口被阻止..
因此,如何避免这种
But my page is not open it displays popblocked..
So how to avoid this
答
这是浏览器的安全功能,只能由用户更改.您无法通过代码进行更改.您需要使用其他替代方法进行弹出.使用此AJAX PopupControl
http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/PopupControl/PopupControl.aspx [ ^ ]
It is a browser security feature and can be altered only by the user. You cannot change it through code. You need to use other alternative for popup. Use this AJAX PopupControl
http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/PopupControl/PopupControl.aspx[^]
尝试一下:
Try this:
RadScriptManager.RegisterClientScriptBlock(base.Page, this.GetType(), "Complete", "window.open('WebForm1.aspx');", true);
--Amt
--Amt