Reputation: 1
Can someone explain to me the sheer purpose of a page load? My code runs just fine without it right now in my aspx.cs (codebehind) file. I am doing very basic stuff here, so im guessing it has a lot of importance somewhere so i am just wondering what that would be. thanks for any help!
Upvotes: 0
Views: 1900
Reputation: 12672
You should check about the Page Life Cycle. The load is an event in this Cycle.
About the method, Page_load()
is the method on the server side application, for an .aspx
file. All code inside of this method is executed once at the beginning of the page.
Also, in the load, if the current request is a postback, control properties are loaded with information recovered from view state and control state. (Different from initialize, when you set the default values)
So, in the Load Event
, the Page object calls the OnLoad
method on the Page object
, and then recursively does the same for each child control until the page and all controls are loaded. The Load event of individual controls occurs after the Load event of the page.
Some links for you:
and there are a few more in Google
Upvotes: 2