Popup Javascript blocked with registerClientScriptBlock

721 Views Asked by At

I'm trying to open a popup at server-side but it seems only work with IE, other browsers block the opening of it.
If i call the javascript function directly on the client-side it works well with all browsers, but i need to call it at server-side with RegisterClientScriptBlock. Any suggestions?

Here is the code:

protected void LinkButton1_Click(object sender, EventArgs e)
{
    ScriptManager.RegisterClientScriptBlock(this, GetType(), "newpage", "wopen('" + url + "');", true);
}


<script type="text/javascript">
    function wopen(url) {
        var w = window.open(url, '', 'width=1000,height=600,toolbar=0,status=0,location=0,menubar=0,directories=0,resizable=1,scrollbars=1');
        w.focus();
    }
</script>
0

There are 0 best solutions below