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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T12:40:12+00:00 2026-05-21T12:40:12+00:00

I understand the ASP.net Page Life Cycle, I get that when I click a

  • 0

I understand the ASP.net Page Life Cycle, I get that when I click a button, it first reloads the page then it executes the code behind for my button. My question is how do I get it so that I can set something before this process happens. I am trying to pass a variable that the button has been clicked, but because of the page life cycle it never receives this. What can I do so that I can determine that this button has been clicked maybe I am over-thinking this, or even under-thinking.

Page Load:

        ImageButton btn = (ImageButton)(Page.FindControl("displayYImgBtn"));
        if (btn != null)
        {
            string state = btn.CommandArgument;
            if (state == "true")
            {
                search();
                btn.CommandArgument = "false";
            }
        }

Button:

    ImageButton btn = (ImageButton)(sender);
    btn.CommandArgument = "true";
  • 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-21T12:40:13+00:00Added an answer on May 21, 2026 at 12:40 pm

    You could always inspect the post variables directly. If your submit button was clicked, it will have a value in the Request.Form collection, if it’s not postback or some other control caused postback, it shouldn’t appear.

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

Sidebar

Related Questions

I am trying to understand different events in a Asp.net page life cycle. I
I was looking for ASP.net page life cycle events tutorial using examples. I saw
I understand that the AntiForgeryToken feature in ASP.NET MVC does prevent cross-site attacks. However,
I noticed that there is one change about ASP.NET Routing. I cannot understand why
as i understand, when i load a asp.net .aspx page on the (iis)server, it's
I'm trying to understand the ASP.NET OutputCache mechanism. I built a test page with
One thing I don't understand with sending Async emails from ASP.NET page is when
I understand how to post a value back to a standard asp.net page and
I have a little contact-page on my asp.net page. I have ~5 validators that
I'm looking to get a more thorough understanding of the ASP.NET page lifecycle. I'm

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.