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

  • SEARCH
  • Home
  • 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 5957967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:28:34+00:00 2026-05-22T18:28:34+00:00

I have this UpdatePanel I want to use in my website. Basicly the idea

  • 0

I have this UpdatePanel I want to use in my website. Basicly the idea is that a user clicks on a link and start a service on the server that will change a database.

So what I want to write is a method that wil return true or false if the database is updated. The method should run on timed intervals. If the database has been updated it will return true and that should trigger the UpdatePanel to update.

I know you can add triggers through controls. But is it possible to do so through code as well? The idea is that if the user stays on the page after starting the action he will see the result appear when the method returns true. If the user leaves the page he of course sees nothing.

If this is not the right to use this then please say so.

Any comment will be appreciated!
Kind regards,
Floris

  • 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-22T18:28:35+00:00Added an answer on May 22, 2026 at 6:28 pm

    I suggest you use a asp:Timer

    you can place this timer inside or outside of your update panel. if you put it inside the update panel you don’t have to handle the trigger yourself. every post back inside an upatepanel will become Async. but if you put it out side, you have to assign the trigger.

    here are sample codes for your aspx:

         <asp:UpdatePanel runat="server" ID="UPanel1">
            <ContentTemplate>
                <asp:Label ID="MessageLabel" runat="server" ForeColor="Red" Font-Size="X-Large" />
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
            </Triggers>
        </asp:UpdatePanel>
        <asp:Timer ID="Timer1" runat="server" OnTick="Timer1_Clicked" Interval="1000" /> 
    

    while it’s easier to put it inside the update panel:

    <asp:UpdatePanel runat="server" ID="UPanel1">
        <ContentTemplate>
            <asp:Label ID="MessageLabel" runat="server" ForeColor="Red" Font-Size="X-Large" />
             <asp:Timer ID="Timer1" runat="server" OnTick="Timer1_Clicked" Interval="1000" />
        </ContentTemplate>
    </asp:UpdatePanel>
    

    now on the c# side, you must write the event handler method like this one:

            private static int counter = 0;
            protected void Timer1_Clicked(object sender, EventArgs e)
            {
                //DO YOUR WORK WITH DATABASE HERE INSTEAD OF THIS CODE
    
                if (++counter < 5)
                    return;
    
                MessageLabel.Text = "Tadaaaaaah";
            }
    

    in this example, after 5 seconds a tadaaaah will appear on the screen.
    you should update your panel in this event handler. i.e. set a Label’s text.
    I hope I got you problem right.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code in jQuery, that I want to reimplement with the prototype
I have an ASP.NET UpdatePanel that can contain many images, and I want to
So I've got this UpdatePanel. Inside it I have a nifty little jQuery scroll
I have a panel on an aspx page which contains an UpdatePanel. This panel
I have this idea for a free backup application. The largest problem I need
I have this modalPopupExtender, I want it to show a CheckBoxList with some data.
I have some updatepanels in asp.net page. I want updatepanel 2 get refreshed when
This is a simplified version of what I want to do. Basically I have
I have an updatepanel that includes a textbox, a buttun (named 'search') and a
I have a Gridview that I want to filter. My gridview is in an

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.