ASP. NET page sending back and event returning

Source: Internet
Author: User

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 .

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.