This is a migrated thread and some comments may be shown as answers.

Catching Close Event Server Side

2 Answers 91 Views
Notification
This is a migrated thread and some comments may be shown as answers.
Mirek
Top achievements
Rank 1
Mirek asked on 23 Jul 2016, 05:01 PM

I'm trying to have persistent notifications, in other words notifications that show until the user clicks the x (close) button on the notification.  Is there a recommended way to capture this event server side along with the value from the notification being clicked so that I can record these notifications as being seen?

 

Seems similar to what this person was asking:  http://www.telerik.com/forums/how-to-clear-notification-client-server-on-hide-manual-close

 

I see the mention of using the menu to add actions, this isn't exactly what I need... but even there I can find no example of sending anything server side with these actions, only client side.

 

Thanks in advance,

Mirek

 

2 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 25 Jul 2016, 11:50 AM

Hi Mirek,

There is no built-in server event for the user interaction. What I can suggest is that you:

  1. use the OnClientHiding event to know whether the user clicked the [x] button or the control timer ran out and it hid: http://docs.telerik.com/devtools/aspnet-ajax/controls/notification/client-side-programming/events/onclienthiding.
  2. initiate a request to the server and pass the needed information (e.g., a flag that the user dismissed the control). The following blog post offers ideas: http://www.telerik.com/blogs/different-ways-to-make-a-request-to-the-server. Also, the ajaxReques(argument) method RadAjax controls offers may also be interesting: http://docs.telerik.com/devtools/aspnet-ajax/controls/ajaxmanager/client-side-programming/overview.
  3. consider setting AutoCloseDelay to 0 to prevent the control from hiding automatically: http://docs.telerik.com/devtools/aspnet-ajax/controls/notification/server-side-programming/radnotification-object.

Or, you can consider using a RadAlert dialog which is modal: http://docs.telerik.com/devtools/aspnet-ajax/controls/window/alert,-confirm,-prompt-dialogs/radalert-dialog. You can use its callback function to initiate a request.

Regards,

Marin Bratanov
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
Mirek
Top achievements
Rank 1
answered on 26 Jul 2016, 12:44 PM

Thanks Martin,

I'm looking at these... seems like maybe option #2 would work although I'm not understanding it completely at this point.  I already have the autoclosedelay set to 0 all I am lacking is being able to mark the messages as closed.  More or less I need the message to come up on any/all open pages and stay(working) until they close it(not working). 

 

It may be that like you say I need to use another control for this all together.

 

Thanks again,

Mirek

Tags
Notification
Asked by
Mirek
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Mirek
Top achievements
Rank 1
Share this question
or