Doubt about updating content via WS

2 posts, 0 answers
  1. Martin
    Martin avatar
    13 posts
    Member since:
    Nov 2010

    Posted 13 Dec 2011 Link to this post

    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? 

  2. Marin Bratanov
    Marin Bratanov avatar
    3555 posts

    Posted 15 Dec 2011 Link to this post

    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: - 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,
    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
  3. DevCraft R3 2016 release webinar banner
Back to Top