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 / Notification Menu

Notification menu targets
Clear log Event log:


  • Built- in context menu


    RadNotification offers a built-in context menu which can be used to extend the control and to attach some custom functionality. You can use it like the regular RadContextMenu - it supports multiple targets, fully customizable layout, many client-side events and more - essentially the full functionality of the RadContextMenu is employed in RadNotification. If the ShowTitleMenu property is set to true the menu icon will appear next to the close button in the titlebar. You can use both the left and the right mouse buttons to invoke this menu.

Source Code

C# VB.NET
Show code in new window Demo isolation steps
  • <%@ Page Language="C#" AutoEventWireup="true" CodeFile="DefaultCS.aspx.cs" Inherits="Telerik.Web.Examples.Notification.NotificationMenu.DefaultCS" %>

    <%@ 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" %>
    <!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 ID="Headtag1" runat="server" />
        <style type="text/css">
            .userImg
            {
                width: 91px;
                height: 110px;
                border: 3px solid #598f97;
                border-radius: 3px;
                float: left;
            }
            
            .userName
            {
                font-size: 18px;
                font-wight: bold;
                color: #598f97;
                vertical-align: top;
                float: right;
                margin: 30px;
            }
        </style>
    </head>
    <body class="BODY">
        <form id="form1" runat="server">
        <qsf:Header ID="Header1" runat="server" NavigationLanguage="c#" />
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
        <script type="text/javascript">

        //<![CDATA[

            function OnClientItemClicked(sender, args) {
                var itemText = args.get_item().get_text();
                logEvent("<strong>" + itemText + "</strong> item of notification context menu was clicked!");
            }

            function OnClientShowing() {
                logEvent("The context menu of RadNotification is showing!");
            }

            function OnClientShown() {
                logEvent("The context menu of RadNotification is shown!");
            }

            function OnClientHiding() {
                logEvent("The context menu of RadNotification is hiding!");
            }

            function OnClientHidden() {
                logEvent("The context menu of RadNotification is hidden!");
            }

            //]]>
        </script>
        <div style="float: left; padding-top: 25px;">
            <telerik:RadAjaxPanel ID="panel" runat="server">
                <fieldset style="height: 260px; width: 200px;">
                    <legend>Notification menu targets</legend>
    <asp:CheckBoxList ID="options" runat="server" OnSelectedIndexChanged="OnSelectedIndexChanged"
    AutoPostBack="true">

                        <asp:ListItem Text="Show built-in title menu icon" Selected="True"></asp:ListItem>
                        <asp:ListItem Text="image" Selected="True"></asp:ListItem>
                        <asp:ListItem Text="Name"></asp:ListItem>
                    </asp:CheckBoxList>
                </fieldset>
                <telerik:RadNotification ID="RadNotification1" runat="server" VisibleOnPageLoad="true"
                    Width="320" Height="170" Animation="Fade" EnableRoundedCorners="true" EnableShadow="true"
                    Title="Yoshi Tannamuri" ShowTitleMenu="true" OffsetX="-20" OffsetY="-20" AutoCloseDelay="0">
                    <ContentTemplate>
                        <div style="margin: 10px 5px 5px 5px;">
                            <asp:HyperLink ID="Name" runat="server" Text="Yoshi Tannamuri" CssClass="userName"></asp:HyperLink>
                            <div class="userImg">
                                <img id="img" src="../../../Img/Northwind/Customers/Thumbs/LAUGB.jpg" alt="" />
                            </div>
                        </div>
                    </ContentTemplate>
                    <NotificationMenu OnClientItemClicked="OnClientItemClicked" OnClientShowing="OnClientShowing"
                        OnClientShown="OnClientShown" OnClientHiding="OnClientHiding" OnClientHidden="OnClientHidden">
                        <Targets>
                            <telerik:ContextMenuElementTarget ElementID="img" />
                        </Targets>
                        <Items>
                            <telerik:RadMenuItem Text="Sample item 1">
                            </telerik:RadMenuItem>
                            <telerik:RadMenuItem Text="Sample item 2">
                            </telerik:RadMenuItem>
                            <telerik:RadMenuItem Text="Sample item 3">
                            </telerik:RadMenuItem>
                        </Items>
                    </NotificationMenu>
                </telerik:RadNotification>
            </telerik:RadAjaxPanel>
        </div>
        <qsf:EventLogConsole ID="EventLogConsole1" runat="server" AllowClear="true" Width="600"
            Height="280" Style="float: right" />
        <br />
        <qsf:Footer runat="server" ID="Footer1" />
        </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