Firefox中的弹出窗口自动关闭

Firefox中的弹出窗口自动关闭

问题描述:



我有一个带有超链接的网格.单击超链接后,应打开弹出窗口.这在IE中可以正常工作,但在Firefox中不能正常工作.
在firefox中,我单击超链接后,弹出窗口将自动关闭.
我什至在firefox中将阻止弹出窗口"设置设置为false.

Hi,

I have a grid with hyperlinks.On clicking the hyperlink,popup window should open.This is working fine in IE but not in firefox.
In firefox,the popoup window is getting closed automatically as soon as i click on hyperlink.
I have even set the Block pop up window setting as false in firefox.

hlnk_DWFile.NavigateUrl = String.Format("javascript:var PopUpWin = window.open(\u0027DownloadFile.aspx) + "\u0027,\u0027DownloadFile\u0027,\u0027width=400,height=150,scrollbars=no,left=400, top=100,toolbar= no,location= no, menubar= no\u0027)");



我还需要在firefox中设置其他设置吗?.plz帮助

谢谢



Is there any other setting that I have to set in firefox..Plz help

Thanks


请使用以下功能:

用途:
hlnk_DWFile.Attributes.Add("onclick","openPopupWindow(" u0027DownloadFile.aspx)")

只是您必须传递页面URL.

Hi
Please use following function:

Use:
hlnk_DWFile.Attributes.Add("onclick","openPopupWindow(''u0027DownloadFile.aspx'')")

Just you have to pass page URL.

function openPopupWindow(pageURL) {
            var popupWidth = 500;
            var popupHeight = 500;
            var left = (screen.width / 2) - (popupWidth / 2);
            var top = (screen.height / 2) - (popupHeight / 2);
            window.open(pageURL, 'Messages', 'scrollbars=yes,location=yes,status=yes,height=' + popupHeight + ',width=' + popupWidth + ',top=' + top + ',left=' + left);
        }




它将自动打开屏幕弹出窗口的中心,默认高度和宽度为500

谢谢,
Imdadhusen




It will automatically open popup window center of the screen, default Height and Width is 500

Thanks,
Imdadhusen


感谢您的回复Imdadhusen.
我通过在window.open中添加属性来解决此问题.

Thanks for your reply Imdadhusen.
I have fixed the issue by adding an attribute in window.open.

hlnk_DWFile.NavigateUrl = String.Format("javascript:var PopUpWin = window.open(\u0027DownloadFile.aspx)+"\u0027,\u0027modal=yes\u0027);");



谢谢.



Thanks.