The page event sequence is fixed, but the control events on the page depend on the specific page and user operations. If Autopostback Set property True (Default value: False ), The page will be immediately sent back, that is, the values of each control in the page will be uploaded back Web On the server, an event is triggered and handled by the event.ProgramProcessing. If no jump command is displayed after processing, the page is sent to the browser of the client. If Autopostback Set property False , So its events will not be sent back immediately after the first occurrence, instead of waiting for the image Button click This event is returned together. During this period, multiple events may be saved on the client. However, if one event of a control repeats, only the information of the last event is saved.
If Autoeventwireup The property is False (Default value: True ), The page event will not be triggered after the page is returned. Autoeventwireup Properties can be found in @ Page Command, or Web. config File Settings Autoeventwireup Attribute.
Due to the page sending back mechanism, the programmer may need to determine whether the current page is sent to the client for the first time or the page sending back caused by the event. For example, when initializing a page control, if it is sent to the client for the first time, Initialization is required, such as data binding. If it is caused by event return, because it has already been initialized, you do not need to initialize it again. Page Ispostback The attribute is used for sending back check. If it is a resend, Ispostback Value True Otherwise False .