views:

72

answers:

1

I want to build instant messaging notification on my ASP.NET MVC (C#) web aplication. Any example for that or some other way to learn how to do this? I want something like a facebook mailing system.

+1  A: 

Is that some type of a chat system or you would like to display some notification messages.

If it is the second one here is some info to get started.

1) Think about the types of messages you want to be able to display : Success, Error, Information, Fatal ... so on.

2) Most probably the messages will be returned from a controller and javascript will handle those. So, you would need one action result to return all the different types of messages. Thus, you can create your Message class

public class Message{
   public string Message{get;set;}
   public string Type{get;set;}
}

3) Lets say that you want to be able to return the message from anywhere. So, maybe you will need a base controller that all other controllers inherit from. In that controller have action results for all different types of messages. This is in case you need to be able to return a message from any ActionResult.

4) Return your messages as JSON and have a mechanism in your javascript to read the returned object. Just as an idea, have one div to display the message, and based on the type use a nice notification icon.

5) If you would like to make this process async, you can specify some timers/timeouts in javascript and every 5 minutes, check for your notifications.

Hope that is of some help.

sTodorov
I would like to display some notification messages. Tnx
Ognjen