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 8342471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T05:47:02+00:00 2026-06-09T05:47:02+00:00

I have one Update Query on page_load() . I have a button on page.

  • 0

I have one Update Query on page_load(). I have a button on page.
I want to execute that query only once, but when I click on button, the page loads again.

I therefore put that button in update panel.
Now when I click on the button, the page doesn’t seem to be reloading but that update query is executing.

what may be the problem?

  • 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-06-09T05:47:03+00:00Added an answer on June 9, 2026 at 5:47 am

    When using an UpdatePanel it may look like your page doesn’t refresh but actually your whole page life cycle is executed. This is done trough an AJAX request that will only refresh the part within the update panel. You don’t need an UpdatPanel for this situation.

    What you need to do is check in your Page_Load function if the current request is a Postback. A PostBack means that a user action on the page was executed and that an event will be run. If it is, you know that you don’t need to run your query.

    protected void Page_Load(object sender, EventArgs e)
    {
        if(!IsPostBack)
        {
           // Run query
        }
    }
    

    UpdatePanels may give you a false sense of using AJAX but on the inside they run your whole page life cycle and they are not the same as a real AJAX request.

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

Sidebar

Related Questions

I have a query that updates one record, and only one record. Is there
I have one demo application to check select for update query public class Test
I need to have MySQL query like this one: UPDATE table_name SET 1 =
I have to update one element on page with Ajax, do I have to
I have one user (only one, all the others are fine) trying to update
I've creating one ASP web application, in that application one form have to update
I have a few SQL (Select/Update/Insert) syntax that I will run inside PL/SQL one
I have a mystery.html page that loads some javascript (as well as mootools). I
I have an ObjectQuery like that: ObjectQuery<Car> query = GetCarQuery(); than i want to
I have 2 update panel in one update panel i have a datalist and

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.