Ajax Postback
-
I have a custom asp.net calender control that does everything on the client through javascript, and when the user clicks save, the control serializes its state into a hidden field which is then parsed on the server and saved into a database. The problem i have is how to know when the page is posting back, so the control can save its state in the hidden field. When i add a event handler through
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(MySaveMethod);
the changes to the hidden field do not show up on the server, but if i first save the state through a custom click event(onclick="MySaveMethod")
and then submit the page i do see the saved state. It seems that when using thePageRequestManager
the controls are already disposed or the postback is already in action and any changes i make is lost. I want to be able to intercept a postback request, save the control state in the hidden field and retrieve it on the server. Thanks in advanced