locked
SignalR for multi page web app? - multiple OnChange event firing RRS feed

  • Question

  • User-1471650428 posted


    Is SignalR proper for multi-page ASP MVC real time nofitications? I need to create something like Facebook notifications (record updated in db - proper user are being notificated about it).
    But it has problem with OnChange event, which fires up multiple times. I think that's problem with page navigation - one user open main page, then redirect to other so just now 2 dependency listeners are added to that user Am I right? Im talking about this line:

    var dependency = new SqlDependency(command);
                        dependency.OnChange += new OnChangeEventHandler(dependency_OnChangeAcceptedGames);

    It fires up on any page load. And I want you to ask about any solutions.
    Can it be solved with assigning cookies for example so if user has already registered listener it wont register once again?

    If You need some code example to cosider it just let me know.
    Please give my any advice, thanks

    Friday, July 14, 2017 4:06 PM

All replies