Hide radnotification on click when VisibleTitlebar="false"

3 posts, 1 answers
  1. Saranya
    Saranya avatar
    10 posts
    Member since:
    Apr 2013

    Posted 09 Dec 2013 Link to this post

    Hi,

    I am trying to hide the notification when a user clicks anywhere on it - when the title bar is off. 
    I can use JQuery and have tried :

    Setting OnClientClicked="test"

    function test() {
                    alert("hahaha");
                }

    Next tried 

    $('#' + "<%=radNotification.ClientID%>").click(function () {
                                 alert("ho ho ho");
     
                             });

        Next tried OnClientShown=OnClientShown
    function OnClientShown(sender, args) {
                             $(sender).click(function () {
                                 alert("ho ho ho");
                             });
                         }

    Then tried Class = "NotificationTest"

       $('.NotificationTest').click(function () {
                                alert("ho ho ho");
                            });  
     
    and even
     
    $('.RadNotification .RadNotification_Default .SLANotification .rnNoTitleBar').click(function () {
                                alert("ho ho ho");
                            });

    But none of this is working. Please help.
    Thanks
  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 09 Dec 2013 Link to this post

    Hi Saranya,

    Please have a look into the following code snippet to hide the RadNotification on clicking it.

    ASPX:
    <telerik:RadNotification ID="RadNotification1" runat="server" Title="Notification Title"
        ShowCloseButton="false" VisibleTitlebar="false" Text="RadNotification is a light control which can be used to display a notification message"
        VisibleOnPageLoad="true">
    </telerik:RadNotification>

    JavaScript:
    <script type="text/javascript">
        $(document).ready(function () {
            $('.rnContent').click(function () {
                var notification = $find("<%=RadNotification1.ClientID %>");
                notification._close(true);
            });
        });
    </script>

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Saranya
    Saranya avatar
    10 posts
    Member since:
    Apr 2013

    Posted 09 Dec 2013 Link to this post

    Thanks! That worked 
Back to Top