2

im trying to apply this kind of notification with my website. but was wondering if jquery should be the way to go? like every 5 seconds or something to refresh the part of the page if there are any new updates for the record?

or should i do this "Comet" thing that is detailed on this post?

how to implement facebook like notification?

not really sure how to best go about it.

also, this notification will have a lot of refreshes on a specific day of the month when an event is happening so i'm not sure if hitting the dbase every few seconds is the best way? or is there even a difference if i just use comet (where it just recieves data withou request)?

Community
  • 1
  • 1
gdubs
  • 2,724
  • 9
  • 55
  • 102

1 Answers1

1

You don't need to hit the DB every few seconds. You need to broadcast to the connected clients when a new notification is triggered (after you insert the notification in the DB)

You can do this easily with SignalR using Hubs. Check out this documentation that shows how to broadcast only to specified clients.

Eduardo Molteni
  • 38,786
  • 23
  • 141
  • 206