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

Set Event Handlers via JavaScript

Aside from declaring an event handler in the server-side properties of the RadNotification you can also assign them in client-side code. When using the client-side API, pass a reference to the event handler rather than its name. One advantage of using the client-side API is that you can attach multiple event handlers to one event using the standard MS AJAX convention:

JavaScript
function addEvents()
{
    var radNotification1 = $find("<%= RadNotification1.ClientID %>");
    radNotification1.add_shown(clientShown1);
    radNotification1.add_shown(clientShown2);
}

Another advantage of the client-side API is that you can detach an event handler dynamically:

JavaScript
function removeEvents()
{
    var radNotification1 = $find("<%= RadNotification1.ClientID %>");
    radNotification1.remove_shown(clientShown1);
}

A list with the available methods

NameDescription
add_hiddenAdd a handler to the OnClientHidden event.
add_hidingAdd a handler to the OnClientHiding event.
add_showingAdd a handler to the OnClientShowing event.
add_shownAdd a handler to the OnClientShown event.
add_updateErrordd a handler to the OnClientUpdateError event.
add_updatedAdd a handler to the OnClientUpdated event.
add_updatingAdd a handler to the OnClientUpdating event.
remove_hiddenRemove a handler from the OnClientHidden event.
remove_hidingRemove a handler from the OnClientHiding event.
remove_showingRemove a handler from the OnClientShowing event.
remove_shownRemove a handler from the OnClientShown event.
remove_updateErrorRemove a handler from the OnClientUpdateError event.
remove_updatedRemove a handler from the OnClientUpdated event.
remove_updatingRemove a handler from the OnClientUpdating event.

See Also

In this article
See Also
Not finding the help you need?
Contact Support