asp.net + private message system notification - asp.net

I am trying to build a private message inbox system in my asp.net app, using SQL Server to store the messages between users but one thing I am not sure how to achieve is this, for e.g facebook immediately notifies a user when he/she recieves a new message or notification through the action of another user as a red icon on its top navigation bar. I have read through some of the tutorials and guides and most of them requires some sort of polling to the database every few seconds. Can anyone shed some light on what is a good way to go about this?
Thanks.

I have used SignalR to do something similar to this in the past. It can be installed via NuGet by Install-Package SignalR
Scott Hanselman has a great write up: http://www.hanselman.com/blog/AsynchronousScalableWebApplicationsWithRealtimePersistentLongrunningConnectionsWithSignalR.aspx
Also, jabbr.net is a fully functional example of what, I think, is pretty close to what you want to do.

Related

Architect website/mobile notifications generated by users activities

I am working on a mobile application, this application has some features like users can follow each others, adding comments or reviews, like something .. etc.
So the requirement is we have notifications icon in the app, when the user click on it a list of notification will show up, taken in consider those notifications should be real time.
Many things comes to my mind will reviewing this feature, like using firebase to send the notification, or I can develop internal notification service for this purpose.
The question is what do you suggest guys, do you think using firebase is a good idea for such case? or there is something else you recommend for such case
Thank you in advance.
You can try signalR more manageable than firebase but you need to know programing to manage signalR

Persisting SignalR chat app to database

I have a simple SignalR chat application up and running.
However, I can't find anything about how you can persist the messages users send to a database, bizarrely - even though it would seem like an obvious requirement.
This is because we need a record of what people are saying, and want users who join to see the last few messages.
I have two SignalR books - neither cover this topic (Apress Pro ASP.net SignalR, and the Microsoft Press book SignalR programming).
Google searches return nothing about persisting messages to a database and I've found no samples that do this.
Am I missing something? How can I do this?
Thanks.

SignalR 2.0 with database update asp.net

I needed to do some notification concept for my asp.net project like facebook notifications. if a user added something in database. the notification icon will be +1 and when you click the icon, you'll see who added what to database like fb. so i needed to run SignalR function if database update is OK in codebehind. I'm new in SignalR and trying to figure it out. i'm not working with MVC btw. trying some tutorials now. so keep it easy please :)
The way I see this, I would notify my clients right after the database operations. So it would look something like this:
db.Save(objectToSave);
var context = GlobalHost.ConnectionManager.GetHubContext<MyHub>();
context.Clients.All.notifyChange();
In this way, you are able to call clients from outside your hub, so you can have this sort of calls to your clients right after you update the database.
You can also have a look at this tutorial , also this one explains notifications..
If you are familiar with working with databases, keep in mind the approach: just call your clients right after saving in the database.
Hope this helps. Best of luck!

How to Push some data from Database to asp.net webform?

I want to push some thing (like Notification) to user's page, i tried a function that search database and then DB had new notification, it showed the Notification to us, but it was a bad way, someone know how i can do it better?
You can use Comet or SignalR. This is a LINK to explain how use it
You need to implement Client side side based code, so use ajax and java script to that...

ASP.NET - Interaction with Other Websites

I was wondering if it is even possible to interact with other websites using my own.
Here is the scenario:
Lets say I have a Lockerz account, which is a place where you do daily tasks to earn points. Once a month you can redeem those points to get prizes such as an ipod, macbook, or other items. I know that sounds rediculous, but stay with me.
For someone to gain membership to this website they must be invited by a member. So I get your email address then log in to my account, then send you an invite from there.
What I want to do is create a website where a user enters their email into a textbox and presses a submit button. From there the program, behind the scenes, sends my login information, and the users email address to lockerz and sends the invite. All without ever leaving my site.
I have worked with ASP.NET with VB codebehind for a while now, so I understand the basics of that. I am just wondering if what i want to do is even possible. If so, can someone redirect me to a tutorial or guide of some kind that will give me a basic knowledge on this.
Thanks
You'll have to work down at the HTTP level, sending POST and GET requests.
Fortunately, .NET has the WebRequest and WebClient classes to help you.
WebClient would probably be your best starting point... But I would hang on a second.
Websites like this tend to employ some pretty intense fraud-protection. Banning, blocking or at least ignoring actions when multiple accounts use one IP, or otherwise do things in a predictable pattern.
WebClient isn't going to load up the JavaScript either so you might you can't access required parts of the page.
Either way, you don't need to do this on your webserver - I'd start off by writing it initial connect code locally as a simple script. It'll make testing it a lot faster.

Resources