views:

38

answers:

3

Hi everyone,

i've got a situtation where we have a web site (mvc project), and a wcf service, when service gets message i need to show a notification to user who's on the web site with this message contents.

would be glad if you can show me the place where to start!

Thank You !

+1  A: 

I think you need to place javascript timer on your page which will do ajax for example: "/Messages/GetLastUnreadMessage".

Tim
+1  A: 

You'll need to have a bit of javascript that makes an AJAX call back to your site from the client page on a regular basis that checks to see if there are new messages, and displays them if there are.

There's no way for your web server to 'notify' an already rendered client page in the other direction (providing I understand your requirement correctly).

Paddy
+1  A: 

You probably need some javascript on your page that polls the server at a certain interval to check if there is something to show to the user.

Here is a nice article on how to create a WCF service and call it from the browser using JQuery

Thomas