How to send notification internally?
Ask by ICSM Computer
Updated 18 Jun 2025
To send internal (in-app) notifications using SignalR, you can broadcast or send messages to specific users or groups without page reloads.
Here’s a full breakdown of how to implement internal notifications in an ASP.NET Core or ASP.NET MVC + SignalR app:
1. Define a Hub
C# (NotificationHub.cs)
2. Configure SignalR in Startup
ASP.NET Core:
In
Startup.cs:✅ 3. Client-Side JavaScript
HTML + JS:
4. Send Notifications from Backend
Example in a Controller:
5. Make Sure Authentication is Set Up for Targeted Users
For
Clients.User(userId)to work:userIdfromClaimsPrincipal.NameIdentifier.Optional Enhancements