Class AjaxMethodCallback

The AjaxMethodCallback 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.

Methods called use JSON to pass data and simple types, hierarchical objects, arrays and IList based classes are supported for two-way transfers. DataSets/DataTables/DataRows are support for downloading only at this time.

This control makes accessing server side content as easy as calling a single proxy method and implementing a single client side handler to receive the result value as a strongly typed object.

System.Object
  System.Web.UI.Control
    Westwind.Web.Controls.AjaxMethodCallback
public class AjaxMethodCallback : Control

Class Members

MemberDescription

Constructor

CreateControlInstanceOnPage

Can be called to create a new instance of the AjaxMethodCallbackControl and attach it to the current page. This can be useful for control developers so they don't have to manually add the control to the page.

public static AjaxMethodCallback CreateControlInstanceOnPage(Control control,     object targetInstance)

ClientID

Override to force simple IDs all around

ClientProxyTargetType

A type that is used to generate the Client Proxy Javascript class that gets injected into the page with matching methods.

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 AjaxMethodCallback control.

IsCallback

Determines whether the current request is in a callback.

jQueryScriptLocation

Determines where the jquery.js resource is loaded from. WebResources, Url or leave empty to do nothing

JsonDateEncoding

Determines how the date format is serialized into JSON.

OverrideClientID

Determines whether ClientID and UniqueID values are returned as just as the ID or use full naming container syntax.

PageProcessingMode

Determines when Page level callbacks are processed in the Page pipeline. By default processing occurs in Load, but you can opt to process callbacks in Init for better performance if you don't rely on any page specific logic or POST values from controls.

PostBackFormName

The name of the form from which POST data is sent to the server if posting back with form data. Empty value will post back all form variables of all forms.

PostBackMode

Detemines how data is sent back to the server on a method call.

ScriptLocation

Determines where the ww.jquery.js resource is loaded from. WebResources, Url or an empty string (no resource loaded)

ServerUrl

The Url to hit on the server for the callback to return the result. Note: Not used when doing a MethodCallback

ServiceType

The type of service to call. For AjaxMethodCallback call the current page, control or CallbackHandler. For WCF and ASMX point at ServerUrl at a WCF or ASMX Service respectively.

TargetInstance

An instance of the object that is going to handle the callbacks on the the server.

Timeout

Timeout in milliseconds for the request.

UniqueID

Override to force simple IDs all around

Requirements

Namespace: Westwind.Web.Controls
Assembly: westwind.web.webforms.dll

© West Wind Technologies, 1996-2016 • Updated: 12/12/15
Comment or report problem with topic