Click here to Skip to main content
15,897,891 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
is the entire page including the Page_Load is ‘posted back‘ when we click on Button click?
Posted

1 solution

When you click the button, it causes a PostBack which will trigger the Page_Load event of your Asp.Net page.

You can check to see if it's a postback though, so you don't run code that should only run during an initial load.

e.g

C#
private void Page_Load()
{
    if (!IsPostBack)
    {
        // Something that only happens in the first load
    }
}


Have a look here, which describes ViewState and postback processing

http://delphi.about.com/library/weekly/aa051705a.htm[^]
 
Share this answer
 
Comments
fjdiewornncalwe 27-Sep-12 11:08am    
+5. Of course.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900