Version: 4.0.4.0
Ajax technology accesses server-side power using callbacks without reloading the browser page. Easily create Rich Internet Applications without writing JavaScript!

LiveCallback ASP.NET Server Control Information

This page includes information about the LiveCallback Server Control, which is included in PowerWEB LiveControls for ASP.NET:

[View LiveControl Demo]

While remote-scripting functionality required by most web applications is encapsulated by the other controls included with LiveControls for ASP.NET, there are times when a more custom callback is required. For these purposes, the LiveCallback control is used. The LiveCallback control is used to call a server function (and get the return value from the function) from the browser without refreshing the page. Simply drag a LiveCallback control on a webform, create the server function to call, then call the client-side "pwBeginCallServerFunction" function and a callback is transparently sent to the server, calling the function, and returning the value to the client.

Remember! Any LiveControl which raises a callback to the server (such as LiveCallback) raises a server event within which ANY client-side element can be visually updated without refreshing the page!

The LiveCallback control has the following features:

  • Cross-browser compatible, no plugins, downloads, or security warnings.
  • From client-side script, call a server function without refreshing the page.
  • Pass up to 9 parameters into the server function.
  • Operates as a transparent, background operation.

Some example uses for LiveCallback:

  • Pass data transparently to the server as needed.
  • Create a text "autosave" feature which works in the background while the user fills out a textbox.
  • Create custom your own custom LiveControls by wiring a server-side function to a client-side event.

 

Browser Compatibility

LiveControls have been tested and are fully "callback-compatible" in the following browsers:

  • Microsoft Internet Explorer 5.0+ for Windows
  • Microsoft Interner Explorer 5.0+ for Macintosh
  • Netscape 7.1+ for Windows
  • Netscape 7.1+ for Macintosh OS X
  • Mozilla 1.3+ for Windows
  • Mozilla 1.3+ for Macintosh OS X
  • Firefox for Windows
  • Firefox for Macintosh OS X
  • Camino for Macintosh OS X
  • Konqueror based engines
  • Galeon
  • Opera 5.0+

If a browser which is not compatible accesses a page containing LiveControls, the controls will fall back to the standard ASP.NET functionality. For example, a LiveButton issues a transparent callback when clicked. If on a non-compatible page, the button will still be displayed, but will cause a standard postback when clicked.

Server Tag Example

The following code demonstrates the server tags and JavaScript required to call a server function.

<script language="javascript">
function doCallback(){
   pwBeginCallServerFunction("ServerFunction", "clientFunction", "", false);
}
function clientFunction(response){
   alert(response.data);
}
</script>
<input type="button" value="Click me" onclick="doCallback()">
<cc1:LiveCallback id="LiveCallback1" runat="server"></cc1:LiveCallback>

Code-Behind Example

This code demonstrates an example server function to call from the client-side.

public string ServerFunction()
{
   return "This is from the server.";
}