| |

VerySource

 Forgot password?
 Register
Search
View: 1234|Reply: 12

Please master to explain the meaning of IsPostBack ()

[Copy link]

7

Threads

16

Posts

14.00

Credits

Newbie

Rank: 1

Credits
14.00

 China

Post time: 2020-2-21 10:00:02
| Show all posts |Read mode
I now think that the request for the .aspx page, if it is not modified and just browsed, is IsPostBack () == false no matter how many times, only when the user modifies the page (such as filling forms, entering data, etc.), the server sends back It will be IsPostBack () == true. I wonder if this understanding is correct? I would like to know under what circumstances will it be! IsPostBack (), and under what circumstances will it be IsPostBack (). Thank you!
Reply

Use magic Report

0

Threads

43

Posts

29.00

Credits

Newbie

Rank: 1

Credits
29.00

 China

Post time: 2020-4-29 21:15:02
| Show all posts
The first time to open and refresh are: not IsPostBack
Reply

Use magic Report

0

Threads

43

Posts

29.00

Credits

Newbie

Rank: 1

Credits
29.00

 China

Post time: 2020-4-29 23:45:01
| Show all posts
Perform a background action, the server sends back, which is IsPostBack
Reply

Use magic Report

0

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-4-30 14:30:01
| Show all posts
Open the page for the first time: The value of IsPostBack () is false;
Back to the server, IsPostBack () becomes true;
! Is negated, generally
if (! IsPostBack)
{
// Represents the first page read
}
else
{
  // Return the code in the future
}
Reply

Use magic Report

0

Threads

26

Posts

20.00

Credits

Newbie

Rank: 1

Credits
20.00

 China

Post time: 2020-5-1 23:00:01
| Show all posts
To put it bluntly, when you enter the page, go to if (! IsPostBack), then after your page refreshes (submitted to the server, etc.), you will not go
Reply

Use magic Report

7

Threads

16

Posts

14.00

Credits

Newbie

Rank: 1

Credits
14.00

 China

 Author| Post time: 2020-5-3 18:45:01
| Show all posts
Please explain further:
return?
Postback?
Callback?

Who is it to whom, who to whom and who to call? Thank you!
Reply

Use magic Report

1

Threads

6

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 Australia

Post time: 2020-5-5 11:30:01
| Show all posts
xiaoren6412
correct
Reply

Use magic Report

0

Threads

64

Posts

35.00

Credits

Newbie

Rank: 1

Credits
35.00

 China

Post time: 2020-5-6 20:45:01
| Show all posts
Open the client source code of your asp.net page, you will see a
  <input type = "hidden" name = "__ VIEWSTATE" id = "__ VIEWSTATE" .... />
Field, this is the source of the IsPostback function.

When the page is requested with the http Post command and the parameter contains this __VIEWSTATE, the page's IsPostback == true.

Both Postback and Callback are IsPostback == true. In the latter case, the difference between callback and postback can be further distinguished by the IsCallback function of the page.
Reply

Use magic Report

0

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-5-7 20:45:02
| Show all posts
Thank you all
Before, I only knew whatxiaoren6412said
Open the page for the first time: the value of IsPostBack () is false;
Back to the server, IsPostBack () becomes true;
! Is negated, generally
if (! IsPostBack)
{
// Represents the first page read
}
else
{
  // Return the code in the future
}
  
It ’s really beneficial to come here often! !
Reply

Use magic Report

7

Threads

16

Posts

14.00

Credits

Newbie

Rank: 1

Credits
14.00

 Invalid IP Address

 Author| Post time: 2020-5-8 15:30:02
| Show all posts
So, what is the difference between Request and Postback?
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list