New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

OnClientDataLoadingError

The OnClientDataLoadingError event is fired by the RadLiveTile when its data request has failed and has returned an error. You can check the error message if one is present and prevent the alert box that will usually show it. The format of the informational alert is "RadLiveTile data request failed :\n Exception=" + errorMessage.

The event handler receives two arguments:

  1. The RadLiveTile that fired the event

  2. An event arguments object that exposes the following members:

OnClientDataLoadingError event arguments object members

NameReturn typeArgumentsDescription
get_cancelErrorAlert()boolReturns a value that indicates whether the error alert will be shown.
get_errorMessage()stringReturns the error message sent from the server. If no such information is available the LiveTile will return "No error data available" .
set_cancelErrorAlert()boolSets a flag that indicates whether the alert with the server error message will be shown to the user. Defaults to false , so an alert will be shown.

The following example shows how the error alert can be prevented based on a the condition that the server error response contains the 500 keyword. This is the generic status code for a server error, so we assume there is no concrete information to show:

JavaScript
<script type="text/javascript">
	function OnClientDataLoadingError(sender, args)
	{
		if (args.get_errorMessage().indexOf("500") > -1)
			args.set_cancelErrorAlert(true);
	}
</script>
<telerik:RadLiveTile OnClientDataLoadingError="OnClientDataLoadingError" ID="RadLiveTile1"
					 runat="server" UpdateInterval="7000">
	<WebServiceSettings Path="TrafficInformation.asmx" Method="GetTrafficDataPerPerson"></WebServiceSettings>
	<ClientTemplateAnimationSettings Animation="None" AnimationDuration="1000" Easing="" />
	<ClientTemplate>
		<div style="width:150px; height: 150px;">
			<img alt="" src="Img/Customers/#= CustomerID #.jpg" />
			<div style="color:black; font-weight: bold; position: absolute; bottom: 5px;">Violations: #= Violations #</div>
			</div>
	</ClientTemplate>
</telerik:RadLiveTile>
Not finding the help you need?
Contact Support