May 12, 2021 ASP.NET
An event handle is a sub-routine that executes code for a given event.
When a ASP.NET event is triggered in the event, the sub-routine for that event is called. For more information, please refer to below.
Take a look at the code below:
When will the above code be executed? The answer is: "I don't know..."
Page_Load event is ASP.NET one of many events that can be understood by the united states. Page_Load event is triggered when the page loads, ASP.NET will automatically call the Page_Load sublole and execute the code in it:
Note: Page_Load event does not contain object references or event parameters!
Page_Load sub-routine runs every time the page loads. I f you only want to execute the code in the Page_Load subrouge the first time the page loads, you can use the Page.IsPostBack property. If the Page.IsPostBack property is set to false, the page is loaded for the first time, and if set to true, the page is passed back to the server (for example, by clicking the button on the form):
The above example only shows "The date and time is..." when the page is first loaded. N ews. When the user clicks the Submit button, the submit sub-routine will write "Hello World!" in the second label, but the date and time in the first label will not change.
The above is an ASP.NET the use of the event handle.