title: Imagebutton onclick not working in updatepanel, How can I make it work?
body: <pre><code> &lt;asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" ChildrenAsTriggers="true"   
   runat="server"&gt;
    &lt;ContentTemplate&gt; 
       &lt;asp:ImageButton ID="imagebutton1" runat="server" ImageUrl="~/image.jpg" Width="125" 
       Height="125"  onclick="imagebutton1_Click" /&gt;
       &lt;asp:Timer ID="timer1" runat="server" Interval="10000" ontick="timer1_Tick" /&gt;
       &lt;asp:Label ID="label1" Visible="false" runat="server" Text="" /&gt;
    &lt;/ContentTemplate&gt;
  &lt;/asp:UpdatePanel&gt;
  </code></pre>
  
  <p>If I don't use an update panel the whole page refreshes.</p>
  
  <pre><code>protected void imagebutton1_Click(object sender, ImageClickEventArgs e){
      string link = label1.Text;
      Page.ClientScript.RegisterStartupScript(this.GetType(), "OPEN", "window.open(" + link +   
      ",'mywindow','width=200,height=200,');", true);
  }
  </code></pre>
  
  <p>This is the variable "link" here in the timer handler</p>
  
  <pre><code>Random r = new Random();
  
  if (datatable1.Rows.Count &gt; 0)
  {
      int randomnumber = r.Next(0, i);
      DataRow datarow1= datatable1.Rows[randomnumber ];
      imagebutton1.ImageUrl = (String)datarow1["image"];
      imagebutton1.DataBind();
      label1.Text = (String)datarow1["Link"];
  }
  </code></pre>