If (! Ispostback) usage?

Source: Internet
Author: User

1. ispostback explanation: gets a value indicating whether the page is being loaded in response to the client's sending back, or whether the page is being loaded and accessed for the first time, if the page is loaded in response to the client sending back, it is true; otherwise, it is false. For example, if you press the button on the page, you will see that ispostback is equal to true during page_load; if your page is opened for the first time, false is returned ;! This. ispostback is always true, and the content on this page is always regarded as the first time to open.
Ii. Usage:

If (! This. ispostback)
{

// Todo: Put the page initialization code.

}

Iii. Summary:

1 ,! The code in ispostback indicates what to do when the page is opened for the first time.Initialization.

2, if (! This. ispostback) code is only executed once. If the page is refreshed again, this statement is not executed.

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.