Last post Sep 17, 2018 04:01 PM by PatriceSc
Sep 14, 2018 02:27 PM|jonnygareth30|LINK
I would like to create a notification icon which displays the number of notifications next to the icon which is populated by using MSSQL DB (e.g. Stored Procedures). Firstly I am wondering if so is this only possible though the use of SignalR?
Any help would be greatly appreciated.
Sep 14, 2018 03:20 PM|PatriceSc|LINK
That is you want to trigger a server side processing using Ajax and get back notifications immediately while the Ajax request is still running ? This is basically the purpose of SignalR (sending back to a client side while a server processing happens).
Sep 17, 2018 03:22 AM|Fei Han - MSFT|LINK
ASP.NET SignalR can help developer build real-time web functionality easily, if you'd like to display notifications in real time, using SignalR is a good approach.
You can refer to this thread: "facebook like notification lin MVC5", you can find the sample code that I shared to achieve facebook-like notification functionality
Sep 17, 2018 11:27 AM|jonnygareth30|LINK
Hi Fei Han,
Thank you, this is exactly what I am looking for but I have a query. Would I be able to use a stored procedure to create a flag on the notification icon? (e.g. if there are 3 rows selected from my stored procedure would the notification icon be able to display
the data as a notification on the icon?)
Sep 17, 2018 04:01 PM|PatriceSc|LINK
It's basically unrelated. You are free to do whatever you want.
The first point would be to make sure if you want to show this information after a full postback or to show new notifications even during an Ajax call (this is the case where SignalR is needed). If you are not comfortable with that you could start by showing
the info after a full postback (more likely it is needed anyway) and then move to updating that during Ajax calls as well...