New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

Client-side Programming Overview

Each RadTile control offers a rich set of client-side events that allow the developer to modify their behavior. You can, for example, obtain information about the selected or clicked tiles,change the page they will navigate to or prevent selection, navigation or the postback according to the desired logic:

  • OnClientClicking—fires when a tile is being clicked. It can be used to prevent the navigation and the postback or to change the URL.

  • OnClientClicked—fires after a tile is clicked. Can be used to compare the original NavigateUrl with the current and to cancel the postback.

  • OnClientLoad—fires after a tile is created. Can be used to store a reference or modify its object.

  • OnClientSelecting—fires just before a tile is selected and can be used to prevent the selection and the automatic postback.

  • OnClientSelected—fires after a tile is selected. It can be used to prevent the postback.

The RadLiveTile offers additional events that are related to its load-on-demand purpose:

  • OnClientDataLoaded—fires when data request returns the data successfully.

  • OnClientDataLoading—fires before the data request is executed. Arguments can be changed here and it can also be cancelled.

  • OnClientDataLoadingError—fires when the data request returns an error so it can be handled.

  • OnClientTemplateDataBound—fires after the ClientTemplate is data bound (i.e., the information from the request is resolved in the template).

If selection is disabled the OnClientSelecting and OnClientSelected events will not be fired at all.

Getting the Tile Control Client-side Object

Tile creates a client-side object with the ClientID of the control.You can obtain the reference using the following JavaScript code:

<telerik:RadTextTile ID="Tile1" runat="server">
</telerik:RadTextTile>
<script>
    Sys.Application.add_load(function () {
            var tile = $find("<%= Tile1.ClientID %>");
            alert(tile.get_id());
        }
    );
</script>

All Tile types inherit the RadBaseTile type and has the API it provides in addition to its own specific methods.

See Also

In this article