This class is mapped to the client side wwAjaxMethodCallback class which is automated by the server control to perform the client side callbacks.
To initiate a client side callback to the server:
<ww:wwAjaxMethodCallback ID="Proxy" runat="server" PostBackMode="Post" PostBackFormName="form1" ScriptLocationType="WebResource" AllowedPageMethods="Helloworld,AddNumbers,GetDeveloperList,GetDeveloper,SaveDeveloper"> </ww:wwAjaxMethodCallback>
Client side code can then call server methods with Proxy.callMethod where Proxy is the ID of the control:
On the server side the implementation simply implements the Helloworld method (and any others) on the form as methods. The default target object is the Web Control Page the control lives on, but optionally the control allows routing requests to any other object via the TargetObject property.
Callbacks handled by this control can return also JSONP responses by specifying a callback= query string parameter. You can use $.getJSON("ajaxrequest.wwd?callback=?") which jQuery to return remote data for example.
Please be aware that when making method callbacks OnInit() and OnLoad() events are fired both on the form and the control. If you have code in the page's OnInit() or OnLoad() use this.Page.CallbackControl.IsCallback to exit early if desired.
If you use this control from a user control and you want to route the callback handling code to a method in the user control you have to explcitly assign the TargetObject to the control in the OnInit():*** In a User Control use code like this to route User Control methods FUNCTION OnInit() this.HeaderProxy.TargetObject = this DODEFAULT() RETURN
|Allows capturing of errors that occur during callback method processing, since callback method errors are independently handled inside of a TRY/CATCH.|
|Specify a comma delimited list of methods you allow to be called remotely. Leave blank to allow any method (not recommended)|
|The name of the form used for PostBack. If blank defaults to Forms|
|PostMethodParametersOnly, Get, Post, PostNoViewState|
|Location of the script file: WebResource, EmbeddedInPage or relative URL (~/images/wwScriptLibrary.js)|
|The URL to post back to. Leave blank for the current page|
|The object on which methods are called. Defaults to the Page.|
See also:Client Class AjaxMethodCallback | Remote AJAX Method Calls using JSON Serialization
Comment or report problem with topic