如何使用javascript更新数据库并具有读取和未读消息的计数器 [英] How to update database with javascript and have a counter for read and unread messages
本文介绍了如何使用javascript更新数据库并具有读取和未读消息的计数器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hello Guys,我有一个论坛应用程序,我希望它像通知系统 其他所有普通应用程序 codeproject中的。如果用户阅读消息,则应在数据库中指示 读取。并且 中的任何其他消息都应指示 未读。
请知道 i 获取以实现这 ??
我尝试了什么:
Hello Guys,我有一个论坛应用程序,我希望它像所有其他普通应用程序中的通知系统,如codeproject中的那个。如果用户读取消息,则应在数据库中指示为已读。并且任何其他消息都应该表示未读。
请问我们如何实现这一目标?
解决方案
您可以使用SignalR。检查我创建的文档,其中包含要阅读和实现的资源 - 使用SignalR 实时通知 - Docs.com [ ^ ]。
读/未读只是在您的表上有一个布尔字段并在用户在UI上打开消息时更新。
Hello Guys, Please i have a forum app and I want it to be like the notification system in every other normal app like the one in codeproject. If a user reads a message , it should indicate in the databse as read. And anyother message that comes in should indicate as unread.
Please Guys how do i get to achieve this??
What I have tried:
Hello Guys, Please i have a forum app and I want it to be like the notification system in every other normal app like the one in codeproject. If a user reads a message , it should indicate in the databse as read. And anyother message that comes in should indicate as unread.
Please Guys how do i get to achieve this??
解决方案
You can use SignalR. Check the doc I created which contains resources to read and implement - Real Time Notification using SignalR - Docs.com[^].
Read/Unread is just a matter of having a boolean field on your table and updating when user opens the message on UI.
这篇关于如何使用javascript更新数据库并具有读取和未读消息的计数器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文