Note that there are some explanatory texts on larger screens.

plurals
  1. POCannot open a new window from inside update panel on linkbutton click
    primarykey
    data
    text
    <p>I have a link button inside UpdatePanel in a div popup. On Button_Click, I wish to open a new window through javascript. I tried both ScriptManager.RegisterStartupScript as well as ScriptManager.RegisterClientScriptBlock, but Window doesn't open.</p> <pre><code> &lt;asp:UpdatePanel ID="UpdatePanel2" runat="server"&gt; &lt;ContentTemplate&gt; &lt;form class="message-form" action="#"&gt; &lt;fieldset&gt; &lt;asp:LinkButton ID="LinkButton1" runat="server" class="btn-facebook" Text="facebook" OnClick="LinkButton1_Click"&gt;&lt;/asp:LinkBu tton&gt; &lt;label for="TextBox1"&gt;Or send a message on Blissdate here:&lt;/label&gt; &lt;div class="textarea"&gt; &lt;asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine" Rows="10" Columns="30"&gt;&lt;/asp:TextBox&gt;&lt;asp:Label ID="lbl" runat="server" /&gt; &lt;/div&gt; &lt;div class="btn-holder"&gt; &lt;asp:LinkButton ID="LinkButton2" runat="server" class="btn-send" Text="send" OnClick="LinkButton2_Click"&gt;&lt;/asp:LinkButton&gt; &lt;/div&gt; &lt;/fieldset&gt; &lt;/form&gt; </code></pre> <p> </p> <pre><code>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); } &lt;script type="text/javascript"&gt; 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(); } &lt;/script&gt; </code></pre> <p>Please tell me if something is wrong with the code..</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload