Creating Custom application events

0
0

Hi, is it possible to create custom application events which all active sessions receive?

 

For example, if one session changes something in a specific database table I’d like to raise an event “SomethingChangedUpdateWhenEverExample()”. All sessions would subscribe to this event at startup and handle them when they are fired.

I have little to no experience with this  so I figured I’d ask you smart people 🙂

 

One approach I thought of was to create a public variable in Program.vb and either manually or timed check if this variable was changed. Since the content of the Application.Variable (unless using Application.Session.Variable) is shared between sessions. This could work but is not elegant.

 

Hope you to hear you thoughts/suggestions!

 

Vincent

  • You must to post comments
0
0

Thanks Alaa! I will try and convert the sample to VB and let you know if I run into any issues. At first glance this looks to work!

  • You must to post comments
0
0

Hi Vincent,

What you need to do is that you’ll have to implement Static Events.

I have attached a sample that showcases it.

Please note that you’ll need to disconnect from these static events when the page is disposed.

HTH,
Alaa

//

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.