I would like to call a server side method from javascript, and have read that this is where PageMethods comes into the picture.
I would like to call my method when a Virtual Earth map onLoad event has fired.
I have problems with PageMethods as the method called serverside has to be shared and therefore i cannot reference my controls.
Is there other options ?
You can't access page controls in a page method, because a page method request doesn't transmit ViewState or run through the page life-cycle to create the controls.
If you really need to reference the controls, you canuse an UpdatePanel and __doPostBack to trigger a partial postback (which does allow you to reference the controls).
You can also pass clientside state through parameters if needed.
No comments:
Post a Comment