When using jQuery to POST data back to the server, I’m getting some strange behavior.
If I include __VIEWSTATE and __EVENTVALIDATION in my serialized form data, the IsPostback page variable is set to true, If I exclude these two, the IsPostback is set to false.
Its easy enough for me to include these two variables but does anyone know whats going on behind the scenes?
One of the things the viewstate and eventvalidation track are whether or not a postback has occurred. Considering the event-based ASP.NET page lifecycle, there is no other way to track if a postback has occured than by simply storing the value somewhere.
In other words, you could manually check for postback by digging into the viewstate object and finding the postback boolean and changing it to true. This may not be exactly as described, but it highlights what’s going on inside the viewstate a little better.