AspNet wijmo and SignalR

Originally Posted 4 November 2014, 12:09 pm EST

  • Originally Posted 4 November 2014, 12:09 pm EST

    Hi, i'm facing an annoying problem with SignalR.
    I've a master page where i declare jquery script needed for connection with signalR:



    <script src="<%: ResolveUrl("~/Scripts/jquery-2.1.1.min.js") %>"></script>
    <script src="<%: ResolveUrl("~/Scripts/jquery.signalR-2.1.0.js") %>"></script>
    <script src="<%: ResolveUrl("~/signalr/hubs") %>" type="text/javascript"></script>

    <script type="text/javascript">

    $(function () {
    var logger = $.connection.messageCenterHub;
    logger.client.logMessage = function (msg) {
    ...do something...
    };
    $.connection.hub.start();
    });

    </script>



    In the master page i perform the connection, via signalr, with server.
    In a content page i need to use a wijmo control.
    When i add a wijmo control the signalR connection stops to work. This is happening probably because the wijmo control reference its jquery script overwriting the master page declaration.
    The error is that connection is undefined.
    Is there a solution to use wijmo in this architecture? It is mandatory that signalR connection is managed in the master page.
    Thank you.
  • Reply

    Hello,

    Studio for ASP.NET Wijmo controls use a specific version of JQuery implicitly, hence it is possible that the JQuery used for SignalR is overriden when loading the Wijmo controls. Hence you need to use two different versions of JQuery on the same page, which is a generic issue. You may refer to the following links which describe how you can multiple versions of JQuery on the same page:

    http://stackoverflow.com/questions/1566595/can-i-use-multiple-versions-of-jquery-on-the-same-page
    http://stackoverflow.com/questions/13331193/multiple-versions-of-jquery-on-the-same-page
    http://api.jquery.com/jquery.noconflict/
    https://forum.jquery.com/topic/multiple-versions-of-jquery-on-the-same-page

    Hope it helps. In case the issue still persists, I would request you to share a sample application depicting your issue so that I can replicate the issue at my end and debug it further.

    Thanks,
    Manpreet Kaur
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels