Ajax Button Control
LiveButton ASP.NET Server Control Information
LiveLinkButton ASP.NET Server Control Information
LiveImageButton ASP.NET Server Control Information
This page includes information about the LiveButton, LiveLinkButton, and LiveImageButton Server Controls, which are included in PowerWEB LiveControls for ASP.NET:
(Note. All of the following references to LiveButton apply equally to LiveLinkButton and LiveImageButton).
The LiveButton server control initiates a remote-scripted callback, raising the Click event on the server. Within this event, modify any UI element, and the visual update occurs on the browser without refreshing the entire page.
Remember! Any LiveControl which raises a callback to the server (such as LiveButton, LiveImageButton, and LiveLinkButton) raises a server event within which ANY client-side element can be visually updated without refreshing the page!
The LiveButton control has the following features:
- Cross-browser compatible, no plugins, downloads, or security warnings.
- Uses same interface as the standard ASP.NET Button, so there is no learning curve.
- Adds a LocationClick event which provides the X and Y coordinates of the mouse-click.
- Use with LiveDataGrid to display a column of buttons in a table that can be used to select, edit, modify, or delete the items in the row.
- Use the Blocking property to cause button is disabled when clicked (and re-enabled when the callback completes) to keep the user from double-clicking the button before the request completes.
- Use in conjunction with a WaitElement to display a message (such as "Processing...") while the callback is pending.
- LiveLinkButton performs the same tasks as LiveButton but presents an HTML hyperlink instead of an HTML button.
- LiveImageButton performs the same tasks as LiveButton but presents an HTML image instead of an HTML button.
Some example uses for LiveButton:
- Use in place of ANY standard ASP.NET button to replace the standard postback with a much "smoother" callback.
- Use the X and Y mouse coordinates available in the LocationClick event to display a popup panel at the location of the mouse click.
- Use anywhere you need to send data to the server (and update the client) without refreshing the page.
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
- 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 tags demonstrate typical settings for initializing a LiveButton, LiveLinkButton, and LiveImageButton.
<cc1:LiveButton id="LiveButton1" runat="server" Text="My Button"></cc1:LiveButton>
<cc1:LiveLinkButton id="LiveLinkButton1" runat="server" Text="MyLinkButton"></cc1:LiveButton>
<cc1:LiveButton id="LiveImageButton1" runat="server" ImageUrl="myimg.gif"></cc1:LiveButton>
This demonstrates handling the LiveButton.Click event
// Click event is raised when the button is clicked.
private void LiveButton1_Click(object sender, System.EventArgs e)
// update a label with the current time
LiveLabel1.Text = DateTime.Now.ToLongTimeString();