Telerik is a leading vendor of ASP.NET AJAX, ASP.NET MVC, Silverlight, WinForms and WPF controls and components, as well as .NET Reporting, .NET ORM , .NET CMS, Code Analysis, Mocking, Team Productivity and Automated Testing Tools. Building on its expertise in interface development and Microsoft technologies, Telerik helps customers build applications with unparalleled richness, responsiveness and interactivity. Telerik products help thousands of companies to be more productive and deliver reliable applications under budget and on time.
Version Q2 2011 released 07/12/2011
select

Notification / WebService support


  • You can combine the VisibleOnPageLoad property and the WebService functionality of RadNotification to make a notification message visible when the page first loads and set its content using a WebService.

    Notice the notification in the bottom right corner of the browser window. You can obtain the up-to-date information in the same manner by pressing the arrow button.

Source Code

C# VB.NET
Show code in new window Demo isolation steps
  • <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>
    <%@ Register TagPrefix="qsf" TagName="Header" Src="~/Common/Header.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="Footer" Src="~/Common/Footer.ascx" %>

    <%@ Page Language="vb" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <qsf:HeadTag runat="server" ID="Headtag1"></qsf:HeadTag>
        <style type="text/css">
            .forecastBgr
            {
                position: relative;
                width: 791px;
                height: 592px;
                margin: 0 auto;
                padding: 0;
                background: url(Img/weatherBgr.jpg) no-repeat;
            }
            
            .buttonWeather
            {
                display: block;
                width: 46px;
                height: 46px;
                position: absolute;
                top: 350px;
                left: 490px;
                background: url(Img/buttonBgr.png) no-repeat 0 0;
                border: 0;
            }
            
            *html .buttonWeather
            {
                background: url(Img/buttonBgrIE6.png) no-repeat 0 0;
            }
            
            .buttonWeather:hover
            {
                background: url(Img/buttonBgr.png) no-repeat 0 -47px;
            }
            
            *html .buttonWeather:hover
            {
                background: url(Img/buttonBgrIE6.png) no-repeat 0 -47px;
            }
            
            .statesDiv
            {
                margin: 0;
                padding: 0;
                width: 128px;
                height: 128px;
                position: absolute;
                top: 250px;
                left: 381px;
                background-image: url(Img/StatesSprite.png);
                background-repeat: no-repeat;
            }
            
            *html .statesDiv
            {
                background-image: url(Img/StatesSpriteIE6.png);
            }
            
            .sunnyState
            {
                background-position: 0 0;
            }
            
            .cloudyState
            {
                background-position: -126px 0;
            }
            
            .rainyState
            {
                background-position: -256px 0;
            }
            .textWrapper
            {
                float: right;
                padding: 30px 10px;
                font-weight: bold;
            }
            
            .imageThumb
            {
                width: 32px;
                height: 32px;
                float: left;
                margin: 28px 0 0 20px;
            }
        </style>
    </head>
    <body class="BODY">
        <form runat="server" id="mainForm" method="post">
        <qsf:Header ID="Header1" runat="server" NavigationLanguage="VB"></qsf:Header>
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
        <script type="text/javascript">

            var CSSClasses = ["sunnyState", "cloudyState", "rainyState"];
            var current = 0;

            setInterval(function () { current = current == 2 ? 0 : current + 1; $get("backgroundDiv").className = "statesDiv " + CSSClasses[current]; }, 1000);

        
        </script>
        <telerik:RadNotification ID="RadNotification1" Animation="Slide" runat="server" OffsetX="-20"
            VisibleOnPageLoad="true" OffsetY="-20" Width="250px" Height="80px" LoadContentOn="EveryShow"
            WebMethodName="GetWeatherForcast" WebMethodPath="NotificationWebService.asmx"
            VisibleTitlebar="false" Value="rainyState" EnableRoundedCorners="true" Skin="Office2007">
        </telerik:RadNotification>
        <script type="text/javascript">

            function GetWeather() {
                var notification = $find("<%= RadNotification1.ClientID %>");
                notification.set_value(CSSClasses[current]);
                notification.show();
            }
        </script>
        <div class="forecastBgr">
            <div class="statesDiv sunnyState" id="backgroundDiv">
            </div>
            <a onclick="GetWeather(); return false;" class="buttonWeather"></a>
        </div>
        <qsf:Footer ID="Footer1" runat="server"></qsf:Footer>
        </form>
    </body>
    </html>

Get more than expected!

 
 

Take your time to truly experience the power of RadControls for ASP.NET AJAX with a free 60-day trial backed up by Telerik’s unlimited dedicated support.

Download your RadControls for ASP.NET AJAX trial and jumpstart your development with the available Getting Started resources.

If you have any questions, do not hesitate to contact us at sales@telerik.com.

Copyright 2002-2024 © Telerik. All right reserved
Telerik Inc, 201 Jones Rd, Waltham, MA 02451