Class wwMethodCallback

The wwMethodCallback control provides an easy mechanism for making page or control level method callbacks from an HTML page. Working with both client side and server side logic you can make remote method calls from the client using two-way JSON serialization to access server side content from client pages.

Methods are mapped from server to the client with an optional client proxy class that allows making direct method calls to the server. Methods on the server are marked up with a [CallbackMethod] to indicate that the methods are accessible for callbacks. These methods can be implemented on the page, any user control, or custom server control. The latter also allows control developers to dynamically route callbacks to their own controls.

You can also use a wwCallbackHandler derived subclass to implement a high performance Http Handler to bypass any Page processing altogether and just execute the remote method.

Methods are called by passing JavaScript values/objects which are marshalled through JSON to the .NET methods. Parameters supported are simple types, plain objects/object maps, hierarchical objects, arrays and IList based classes for two-way transfers. DataSets/DataTables/DataRows are supported only for serialization from .NET into JSON, but can't go back to the server.

For more info see Server Method Callbacks using JSON Serialization.


public class wwMethodCallback : Control

Class Members

GetCallbackEventReference Returns an Event Callback reference string that can be used in Client script to initiate a callback request.
public string GetCallbackEventReference( string QueryStringExpression );
ClientID Override to force simple IDs all around
GenerateClientProxyClass If true generates a proxy class that maps each of the methods exposed with [CallbackMethod] on the current page, user control or control and exposes it as a client side class. The name of the class will be the same as the ID of the wwMethodCallback control.
IsCallback Determines whether the current request is a callback from the wwMethodCallback or wwHoverPanel control.
PostBackFormName The name of the form from which values are posted back to the server. Note only a single form's values can be posted back!
PostBackMode If true causes the page to post back all form variables.
ScriptLocation Determines the location of thte JavaScript support file if ScriptLocationType is set to ExternalFile
ScriptLocationType Determines how the JavasScript code gets embedded into the page.
ServerUrl The Url to hit on the server for the callback to return the result. Note: Not used when doing a MethodCallback
TargetCallbackType The type of the object that is going to be the target of the callback. Typically this will be this.Page, but if you route calls to another control or a handler you need to set this type to allow the control to create the proxy.
TargetControlId Determines which control holds the methods that are to be called. By default this is the Page object, but you can use this in a custom control and route method calls to the control instead.
UniqueID Override to force simple IDs all around


Namespace: Westwind.Web.Controls
Assembly: westwind.ajaxtoolkit.dll

  Last Updated: 3/11/2008 | © West Wind Technologies, 2008