locked
Create ASP.NET C# Notification icon RRS feed

  • Question

  • User-1901014284 posted

    Hi,

    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.

    Thanks

    Jonny

    Friday, September 14, 2018 2:27 PM

All replies

  • User753101303 posted

    Hi,

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

    Friday, September 14, 2018 3:20 PM
  • User61956409 posted

    Hi Jonny,

    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 via SignalR.

    With Regards, 

    Fei Han

    Monday, September 17, 2018 3:22 AM
  • User-1901014284 posted

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

    Many thanks

    Jonny

    Monday, September 17, 2018 11:27 AM
  • User753101303 posted

    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...

    Monday, September 17, 2018 4:01 PM