JQuery POST does not change IsPostback variable

When using jQuery data for POST on the server, I get strange behavior.

If I include __VIEWSTATE and __EVENTVALIDATION in my data as a serialized form, the IsPostback page variable is set to true; if I exclude these two, IsPostback is set to false.

Is it easy for me to include these two variables, but does anyone know what is going on behind the scenes?

+3
source share
3 answers

One of the things on which the viewstate and eventvalidation is tracked is whether a postback has occurred. Given the life cycle of an event-based ASP.NET page, there is no other way to keep track of whether a callback has occurred than simply saving the value somewhere.

In other words, you can manually check the feedback by digging into the viewstate object and detecting the postback logic and changing it to true. This may not be as described, but it emphasizes what happens inside the viewstate a little better.

+4
source

IsPostBack() , , __VIEWSTATE __EVENTVALIDATION . , , , , , HTTP- POST GET, ( , viewstate eventvalidation ( ) string, IsPostBack()

? , , , , , -, IsPostBack .

+2

"postback" jquery, __VIEWSTATE __EVENTVALIDATION. , ASP.NET WebForms . , , WebForms.

0
source

Source: https://habr.com/ru/post/1709570/


All Articles