Base solution for your next web application
Open Closed

Implementation of Signal R in asp.net zero #7678


User avatar
0
huntethan89 created

Hi Team, I am new in SignalR with ASP.NET ZERO. I was tried to implement the SignalR in asp.net zero project as per below code statements

1. Created the MyHub.cs class and its method

public class MyHub : Hub { public void Refresh() { Clients.All.refreshglobally(); } }

2. Added the code snippets in JavaScript file

On Button Click Event

$.connection.hub.start().done(function () { abp.signalr.connect(); var kanbanHub = $.connection.kanbanHub;// Get a reference to the hub kanbanHub.server.refresh(); });

Global Function for all clients

function refreshglobally(){ abp.message.success("Record Updated"); }

In the view of above statements, Can you please provide me best way to implement SignalR in asp.net zero and can I call hub methods from server side (As we done in JavaScript like this “$.connection.hub.start().done(function(){})” )

Thanks in Advance.


3 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    SignalR is properly configured and integrated to the startup template.

    • What is your product version?
    • What is your product type (Angular or MVC)?
    • What is product framework type (.net framework or .net core)?
  • User Avatar
    0
    huntethan89 created
    • Application version is: 4.4.0.0
    • It is MVC
    • .NET framework

    I guess my questions is that the way I have implemented SignalR is working fine but is it the right way to do it in ASP.NET Zero template?

    Thanks.

  • User Avatar
    0
    BobIngham created