This is a migrated thread and some comments may be shown as answers.

Doubt about updating content via WS

1 Answer 44 Views
Notification
This is a migrated thread and some comments may be shown as answers.
Martin
Top achievements
Rank 1
Martin asked on 13 Dec 2011, 09:46 PM
Hi, I can't figure out how to update notification content via WS.
I have a performance issue, Im setting content (simple text content) via server side, and sometimes happens to that notification with autoclosedelay of 5500 goes away before showing it content.
Im showing notifications with server side API, its possible to use WS with server side API? I think isn't possible, so the server side alternative is the oncallback_update event.
Am I right? 

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 15 Dec 2011, 01:17 PM
Hello Martin,

Let me start by asking you to take a look at this help article which, I believe, will shed some light on properly configuring the notification: http://www.telerik.com/help/aspnet-ajax/radnotification-server-side-overview.html - how different properties control when content is loaded or at what intervals.

In your case I believe that setting LoadContentOn to EveryShow should work nicely - it will load new content each time it is shown as it can be seen in this online demo.

You may also find interesting this demo that shows the notification based on some condition from the code-behind passed as the Value property.

Other than that - you are correct that if you wish to set the text in the code-behind you need to use its callback update and not a webservice.

You can, however, integrate the server-side Show() method with a web service - by setting LoadContent to OnEveryShow as is in the first demo I linked. You could add a button that will perform an ajax request, determine whether you need to show the notification and call its Show() method. This, however, would actually result in one more call to the server, as you could simply update the notification in the AJAX request and set its new text there. Which approach you will choose depends on your current scenario, requirements and limitations.


All the best,
Marin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Notification
Asked by
Martin
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or