Notification Closes automatically

7 posts, 2 answers
  1. Miguel
    Miguel avatar
    13 posts
    Member since:
    Nov 2011

    Posted 09 Jan 2012 Link to this post

    I have 2 Rad notification in my project. One i'll show on success and i set it to auto close in 5 seconds. The other one i want it to show the error message and only close if the client did it manually, like this:

    ErrorNotification.Text = msg;
    ErrorNotification.Title = "Error";
    ErrorNotification.ContentIcon = "warning";
    ErrorNotificaton.ShowCloseButton = true;
    ErrorNotification.Show();

    but when i test this, the notification appears for about 3/4 seconds then closes itself. I then noticed that if the mouse is over the notification, it doesn't disappear...

    Thanks in advance!
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 09 Jan 2012 Link to this post

    Hello Miguel,

    Try setting set_autoCloseDelay which sets delay in milliseconds for the notification to close automatically as explained in this documentation.

    -Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Answer
    Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 10 Jan 2012 Link to this post

    Hi Miguel,

    I see that you are using server-side configuration and thus I suggest to set the AutoCloseDelay property on the server as follows:

     

    Copy Code
     
      
    ErrorNotification.Text = msg;
      
    ErrorNotification.Title = "Error";
      
    ErrorNotification.ContentIcon = "warning";
     ErrorNotificaton.ShowCloseButton = true;
     
    ErrorNotification.AutoCloseDelay = 0;
      
    ErrorNotification.Show();

    You could alternatively set it directly in the markup.

    The property itself determines after what amount of milliseconds the notification will automatically close (the default is 3000 millisecond). If you set it to 0, the notification will not close automatically and you will control when this should happen.

    You can directly test the property and the results when different values are set in our online demo below:


    I hope that my reply is detailed enough and helpful, let me know how it goes.


    Kind regards,
    Svetlina Anati
    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
  5. Miguel
    Miguel avatar
    13 posts
    Member since:
    Nov 2011

    Posted 10 Jan 2012 Link to this post

    It worked!

    Thanks
  6. Miguel
    Miguel avatar
    13 posts
    Member since:
    Nov 2011

    Posted 10 Jan 2012 Link to this post

    I have a bug now....

    function show_ErrorNotification(errormsg) {
      var ErrorNotification = $find("<%= ErrorNotification.ClientID %>");
      ErrorNotification.set_text(errormsg);
      ErrorNotification.show();
    };

    but the text isn't set... I've found a thread where it's reported this bug, but on the same thread it says that the bug has been resolved in a later build. I believe i have the final version....

    Any thoughts?

    Thanks in advance!
  7. Answer
    Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 11 Jan 2012 Link to this post

    Hi Miguel,

    Indeed, there was such an issue which is fixed. I tested the method and it worked fine. Would please recheck your version of RadControls?  In case the problem persists  it is most probably related to some configuration or usage of appropriate events on your side and I will really need to examine some fully runnable reproduction code. Please, provide such along with detailed explanations and reproduction steps and I will fix it for you so that you will be then able to apply the same logic in your original application.

    All the best,
    Svetlina Anati
    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
  8. Miguel
    Miguel avatar
    13 posts
    Member since:
    Nov 2011

    Posted 11 Jan 2012 Link to this post

    I've solved the problem by using < content template > :)

    Thanks for the help !
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017