From: Stephen Haberman Date: 2005-04-14T08:47:35+09:00 Subject: Re: What's beyond Rails? > Actually, from poking around MSDN, I get the sense that > postbacks are mix of XMlHtppRequest calls (or the like) > and DHTML. Microsoft does have some docs on remote scripting, but "postback" in ASP.NET terminology has nothing to do with Ajax technologies. In ASP.NET, "postback" means someone GETs a page and then POSTs the form back to the same page. It simply means the user has POSTed back to the same page they were just viewing. The purpose (or perhaps just a side effect), is that ASP.NET can then serialize the page object's state into a hidden form field behind the scenes. 1) A user GETs FooPage.aspx, an HTML file with ASP.NET markup, that also has a FooPage.cs "codebehind" .NET class with relevent business/display logic, etc. 2) FooPage.cs does some stuff and can put anything it wants to keep/persist into this ViewState hash table 3) FooPage.html is written out to the browser - and the ViewState hash table is base64 encoded into a hidden HTML form field 4) User does some stuff and hits submit to POST back into FooPage.html 5) ASP.NET sees the hidden HTML form field, and says "oh, this is a postback!", and deserializes it into the ViewState for the request's instance of FooPage.cs So, summarizing, postback allows ASP.NET to have this magic ViewState hash table that persists across requests, not via a session, but by riding along in the HTML. ASP.NET developers frequently do "super.isPostBack()" (or is it "base.isPostBack()"? -- too many languages) calls in their Page_OnLoad method to tell whether their ViewState is brand new and they should do initialization and put stuff in it, or if it already has stuff in it from the previous request. Also, just FYI, on the few ASP.NET projects I've done I've found the ViewState/postback stuff to be pretty slick. Its pretty well hidden behind the scenes. And from what I've seen, successfully leveraged by a whole lot of their built-in ASP.NET controls/widgets/etc. That being said, I didn't do anything too complicated, so given the original posters frustrations with postback, it seems like YMMV. - Stephen