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)
-
0
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)?
-
0
- 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.
-
0