Asp. NET in IsPostBack detailed

Source: Internet
Author: User

Original address: http://www.cnblogs.com/carekee/articles/2094723.html

1, IsPostBack Introduction
Page.IsPostBack is a flag: whether the current request is opened for the first time . The call methods are: Page.IsPostBack or IsPostBack or This.ispostback or This.Page.IsPostBack, both of which are equivalent.

1) When opening a URL via IE's address bar, the first time it is opened, the page will no longer be opened for the first time when the server is submitted via the page's submit button or the button that can cause the submission to post. . (the button is loaded once per click)//This is very clear: the address bar opens the URL is the first time , the page button or the event that caused the Submit button is the second time

2) IsPostBack is true only if the first time it is opened is false.

3). NET determines whether a page is opened for the first time: request.form.count>0
4) Each time the page load, according to the need
to load each time the code is placed in the IsPostBack, only need to Load the code once to put the IF (! IsPostBack) .

5) Each time the user callbacks the server any information, the IsPostBack property will be raised to determine if this user is

Have you ever done any landing or other events?
6 if (! IsPostBack)
{
Response.Write ("First time submitted!");
}
if (IsPostBack)
{
Response.Write ("press button!");
}

Asp. NET in IsPostBack detailed

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.