RadNotification can be configured to perform a callback to update its content. Generally, this leads to an improved performance as callbacks are more lightweight than postbacks and AJAX requests.
To configure the RadNotification to use a callback, you should assign a handler to its OnCallbackUpdate server event. In addition, you can pass a value from the client to the server and from the server - back to the client as this demo does.
Here is how to do this in more details:
-
Pass a value from client to server . To do this, you should set the desired value to the notification client object. In this demo, the OnClientShowing event is used due to the used configuration. Generally, when the update() method is called (internally or explicitly), the last assigned value is passed. To read the value on the server, you should use the arguments object of the OnCallbackUpdate event handler.
-
Pass a value from OnCallbackUpdate event handler to the client. In the common case, any settings in a callback will not be persisted in the ViewState and will not be passed to the client and this is how callbacks work (if the control was not additionally updated e.g with AJAX). RadNotification, however, allows you to pass a string value. To do so, you should simply set that value to the RadNotification's Value property. After that you can read the value on the client in the OnClientUpdated event.
-
The callback functionality and the OnCallbackUpdate are available and work both for simple and rich content. In the case of simple content, you can directly change the Text and ContentIcon property in the callback without using AJAX to update the notification. In case rich content (the ContentTemplate) is used, any changes you make on the content controls, will be automatically applied, again without need to use an AJAX request.
Click on a person to see whether he/she is available for an online conversation.
Related Resources
Loading Content Via Callback