SignalR and MVC bundle

后端 未结 5 1215
迷失自我
迷失自我 2020-12-15 17:52

I\'m trying to use SignalR with MVC bundle, but having problem finding out how to include the /signalr/hubs script into the bundle. For now I have to insert the path in betw

5条回答
  •  孤街浪徒
    2020-12-15 18:14

    A bit late, but here is my contribution:
    Create a javascript file with the following contents:

    (function ($) {
        $.ajax({
            url: "/signalr/hubs",
            dataType: "script",
            async: false
        });
    }(jQuery));
    

    Then add the file to the bundles collection.
    This will load the "/signalr/hubs" code for you.

提交回复
热议问题