Notification on Interval from Web Service

3 posts, 0 answers
  1. Peter
    Peter avatar
    40 posts
    Member since:
    Jul 2012

    Posted 24 Jul 2015 Link to this post



    im probably being a bit silly but i cant work out how to get this to work properly i want the notification to check on an interval , but get the data from a web service , but if there is no data from the web service i dont want it to pop anything up.


    this is what i have so far

         <telerik:RadNotification ID="RadNotification1" Animation="Slide" runat="server" OffsetX="-20"<br>        VisibleOnPageLoad="true" OffsetY="-20" Width="250px" Height="80px" LoadContentOn="TimeInterval"<br>        WebMethodName="GetWeatherForcast" WebMethodPath="../Services/EclipseService.asmx"<br>        UpdateInterval="30000" AutoCloseDelay="1500" KeepOnMouseOver="true" RenderMode="Lightweight"<br>        VisibleTitlebar="false" Value="rainyState" EnableRoundedCorners="true" Skin="Office2007" OnClientUpdated="OnClientUpdated"><br>    </telerik:RadNotification>


    and for the JS function

        function OnClientUpdated(sender, args) {
            var newMsgs = sender.get_value();
            if (newMsgs != 0) {


    it mostly seems to work , but i need it not to pop up anything when no data is returned from the web service ?


  2. Peter
    Peter avatar
    40 posts
    Member since:
    Jul 2012

    Posted 27 Jul 2015 in reply to Peter Link to this post

    done some additional work and found that i should be using the get_content call


    but i am getting an error Object doesn't support property or method 'get_content'

    any help is appreciated.
  3. Ianko
    Ianko avatar
    1829 posts

    Posted 29 Jul 2015 Link to this post

    Hello Peter,

    Yes, you should use the get_content() method to programmatically understand whether the notification is loaded with no content and if so to cancel the continuation of loading via set_cancel(true) method. However, these methods are exposed in the OnClientUpdating event not OnClientUpdated.

    You can find attached a simple demo that demonstrates how to implement the required behavior.

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top