Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7697311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:58:58+00:00 2026-05-31T21:58:58+00:00

<asp:UpdatePanel ID=UpdatePanel1 UpdateMode=Conditional ChildrenAsTriggers=true runat=server> <ContentTemplate> <asp:ImageButton ID=imagebutton1 runat=server ImageUrl=~/image.jpg Width=125 Height=125 onclick=imagebutton1_Click />

  • 0
 <asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" ChildrenAsTriggers="true"   
 runat="server">
  <ContentTemplate> 
     <asp:ImageButton ID="imagebutton1" runat="server" ImageUrl="~/image.jpg" Width="125" 
     Height="125"  onclick="imagebutton1_Click" />
     <asp:Timer ID="timer1" runat="server" Interval="10000" ontick="timer1_Tick" />
     <asp:Label ID="label1" Visible="false" runat="server" Text="" />
  </ContentTemplate>
</asp:UpdatePanel>

If I don’t use an update panel the whole page refreshes.

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);
}

This is the variable “link” here in the timer handler

Random r = new Random();

if (datatable1.Rows.Count > 0)
{
    int randomnumber = r.Next(0, i);
    DataRow datarow1= datatable1.Rows[randomnumber ];
    imagebutton1.ImageUrl = (String)datarow1["image"];
    imagebutton1.DataBind();
    label1.Text = (String)datarow1["Link"];
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T21:58:59+00:00Added an answer on May 31, 2026 at 9:58 pm

    I had to just add postback triggers as shown below in the updatepanel to make it work.

    <Triggers>
    <asp:PostBackTrigger  ControlID="ImageButton"/>
    </Triggers>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

<asp:UpdatePanel ID=UpdatePanel1 runat=server UpdateMode=Conditional> <ContentTemplate> <div> <asp:DropDownList runat=server EnableViewState=true DataTextField=Name DataValueField=Id DataSourceID=ListSource ID=List OnDataBound=List_OnDataBound
This is my aspx code: <asp:UpdatePanel ID=UpdatePanel1 runat=server UpdateMode=Conditional RenderMode=Inline ChildrenAsTriggers=False> <ContentTemplate> <asp:Button ID=Save
I have a masterpage with an update panel: <asp:UpdatePanel ID=UpdatePanel runat=server ChildrenAsTriggers=true EnableViewState=False UpdateMode=Conditional>
Hi experts please see this code: <asp:UpdatePanel ID=UpdatePanel1 runat=server UpdateMode=Conditional> <ContentTemplate> <table border=1 cellpadding=8
<asp:ScriptManagerProxy ID=ScriptManagerProxy1 runat=server> </asp:ScriptManagerProxy> <asp:UpdatePanel ID=upSchedule runat=server UpdateMode=Conditional ChildrenAsTriggers=false> <ContentTemplate> <script type=text/javascript> function afterRender(data)
<asp:UpdatePanel ID=UpdatePanel1 runat=server UpdateMode=Conditional> <ContentTemplate> <asp:TextBox ID=TextBox1 runat=server></asp:TextBox> <asp:Button ID=Button1 runat=server onclick=Button1_Click Text=Send />
I placed a GridView inside an update panel. <asp:UpdatePanel ID=UpdatePanel4 UpdateMode=Conditional ChildrenAsTriggers=true runat=server> <asp:GridView
I have this code in my .aspx file <asp:UpdatePanel runat=server ID=UpdatePanel1 UpdateMode=Conditional> <ContentTemplate> <asp:PlaceHolder
Look at this markup: <asp:UpdatePanel ID=Panel1 runat=server UpdateMode=Conditional> <ContentTemplate> <asp:DropDownList ID=cboBox1 ClientIDMode=Static AutoPostBack=true runat=server
I have the following update panel tag: <asp:UpdatePanel ID=UpdatePanel1 runat=server UpdateMode=Conditional onload=load()> in my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.