Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 无法在linkbutton单击时从更新面板内部打开新窗口_Javascript_Asp.net_Updatepanel_Scriptmanager - Fatal编程技术网

Javascript 无法在linkbutton单击时从更新面板内部打开新窗口

Javascript 无法在linkbutton单击时从更新面板内部打开新窗口,javascript,asp.net,updatepanel,scriptmanager,Javascript,Asp.net,Updatepanel,Scriptmanager,我在div弹出窗口的UpdatePanel中有一个链接按钮。单击按钮,我希望通过javascript打开一个新窗口。 我尝试了ScriptManager.RegisterStartupScript和ScriptManager.RegisterClientScriptBlock,但窗口未打开 <asp:UpdatePanel ID="UpdatePanel2" runat="server">

我在div弹出窗口的UpdatePanel中有一个链接按钮。单击按钮,我希望通过javascript打开一个新窗口。 我尝试了ScriptManager.RegisterStartupScript和ScriptManager.RegisterClientScriptBlock,但窗口未打开

    <asp:UpdatePanel ID="UpdatePanel2" runat="server">

                                            <ContentTemplate> 
                <form class="message-form" action="#">
                    <fieldset>
    <asp:LinkButton ID="LinkButton1" runat="server" class="btn-facebook" Text="facebook" OnClick="LinkButton1_Click"></asp:LinkBu

tton>
                    <label for="TextBox1">Or send a message on Blissdate here:</label>
                <div class="textarea">
                    <asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine" Rows="10" Columns="30"></asp:TextBox><asp:Label ID="lbl" runat="server" />
                </div>
                <div class="btn-holder">
                    <asp:LinkButton ID="LinkButton2" runat="server" class="btn-send" Text="send" OnClick="LinkButton2_Click"></asp:LinkButton>
                </div>

            </fieldset>
        </form>
protected void LinkButton1_Click(object sender, EventArgs e)
    {
           DataRow[] row1 = ds.Tables[0].Select("FB_Id='" + HiddenField3.Value + "'");
           string url = row1[0].ItemArray[3].ToString();
           lbl.Text = url;
           //ScriptManager.RegisterClientScriptBlock(this, GetType(), "newPage", "window.open('" + url +');", true);
           ScriptManager.RegisterClientScriptBlock(this, GetType(), "newpage", "open('" + url + "');", true);
    }





<script type="text/javascript">
    function open(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>

或在以下日期发送消息:

protected void LinkButton1_Click(object sender, EventArgs e)
    {
           DataRow[] row1 = ds.Tables[0].Select("FB_Id='" + HiddenField3.Value + "'");
           string url = row1[0].ItemArray[3].ToString();
           lbl.Text = url;
           //ScriptManager.RegisterClientScriptBlock(this, GetType(), "newPage", "window.open('" + url +');", true);
           ScriptManager.RegisterClientScriptBlock(this, GetType(), "newpage", "open('" + url + "');", true);
    }





<script type="text/javascript">
    function open(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>
受保护的无效链接按钮1\u单击(对象发送者,事件参数e)
{
DataRow[]row1=ds.Tables[0]。选择(“FB_Id=”“+HiddenField3.Value+”;
字符串url=row1[0]。ItemArray[3]。ToString();
Text=url;
//ScriptManager.RegisterClientScriptBlock(this,GetType(),“newPage”,“window.open(“+url+”);”,true);
RegisterClientScriptBlock(this,GetType(),“newpage”,“open(“+url+”);”,true);
}
函数打开(url){
var w=window.open(url,,'width=1000,height=600,toolbar=0,status=0,location=0,menubar=0,directories=0,resizeable=1,scrollbars=1');
w、 焦点();
}

请告诉我代码是否有问题。

检查浏览器弹出窗口阻止程序是否已启用。请禁用浏览器弹出窗口阻止程序是否有效。

检查浏览器弹出窗口阻止程序是否已启用。请禁用浏览器弹出窗口阻止程序是否有效。…

打开功能重命名为其他功能。如果在浏览器中启动javascript控制台呃,您将看到大量对
open
的递归调用。我不是javascript专家,但我相信您遇到了堆栈溢出异常

protected void LinkButton1_Click(object sender, EventArgs e)
    {
           DataRow[] row1 = ds.Tables[0].Select("FB_Id='" + HiddenField3.Value + "'");
           string url = row1[0].ItemArray[3].ToString();
           lbl.Text = url;
           //ScriptManager.RegisterClientScriptBlock(this, GetType(), "newPage", "window.open('" + url +');", true);
           ScriptManager.RegisterClientScriptBlock(this, GetType(), "newpage", "open('" + url + "');", true);
    }





<script type="text/javascript">
    function open(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>
<script type="text/javascript">
function customOpen(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>

open
函数重命名为其他函数。如果在浏览器中启动javascript控制台,您将看到大量对
open
的递归调用。我不是javascript专家,但我相信您遇到了堆栈溢出异常

protected void LinkButton1_Click(object sender, EventArgs e)
    {
           DataRow[] row1 = ds.Tables[0].Select("FB_Id='" + HiddenField3.Value + "'");
           string url = row1[0].ItemArray[3].ToString();
           lbl.Text = url;
           //ScriptManager.RegisterClientScriptBlock(this, GetType(), "newPage", "window.open('" + url +');", true);
           ScriptManager.RegisterClientScriptBlock(this, GetType(), "newpage", "open('" + url + "');", true);
    }





<script type="text/javascript">
    function open(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>
<script type="text/javascript">
function customOpen(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>