2

I know the question sounds too vague so let me explain exactly what I want to implement.

I have a WebApplication that many users log into to submit a request, Request in my project is a form that accepts some information from the user and when he click submit, it reflects on the administrator page. then the admin can grant or decline this request. and of course the result need to be sent to the user's 'Pending Requests' page.

this process is all about time so I need a clean and efficient way to show the admin the requests instantly and for the user to see the admin's response instantly. (kind of like facebook notification system).

I hope my problem is know clear. I understand that there are many ways to implement this and I have a very small knowledge about them. But I just want you guys to recommend an effecient way because I'm sure that the good ways to do this is limited.

Thanks in advance everybody :)

5 Answers 5

2

I will suggest you take a look at SignalR (https://github.com/SignalR/SignalR). It is a framework developed by a few MS developers for doing long polling/notifications from the server.

Link for webforms walkthrough - http://www.infinitelooping.com/blog/2011/10/17/using-signalr/.

Sign up to request clarification or add additional context in comments.

6 Comments

It looks like a nice tool, but for me it's really hard to use! do you have any good tutorials that shows how to use this tool to pull up data from a database and display them! +1
There is a little walkthrough here: jbeckwith.com/2011/10/12/…. Scott Hanselman blogged about it here: hanselman.com/blog/…
I found those articles. but the problem is they are using MVC and I'm using WebForms and I'm not sure that it will be the same for WebForms. and also there is no database connection at all! .. is there's anyway to get an article that help do this in WebForms with Database connection. I'm really trying to implement this but when I'm dealing with something new It's hard for me to understand the code and adjust it to suit my needs. I apologize for that :)! but I'm still learning. If you have an article or adjustment are easy that you can post or blog about it I Would Really Appreciate It Gary! =D
Sorry it took me so long to get this update out but i have blogged about setting up SignalR in a webforms environment. infinitelooping.com/blog/2011/10/17/using-signalr
No worries at all. but Gary I just need one more thing and it's really an issue for me as I remember people advising not to connect to database via JS. so How can I use your article to and get and send the data from my DataBase !? and btw is it possible to access a GridView instead of this line $('#messages').append('<li>' + message + '</li>'); from JS ?
|
1

You could also look into using a Timer control. It's a client side control that will cause a postback for ASP.NET AJAX applications. Here's a simple tutorial

http://ajax.net-tutorials.com/controls/timer-control/

2 Comments

I'll take a look on the tutorial and update :) Thanks Jason. +1
Np. I implemented an ASP.NET dashboard app that would auto update using update panels and timer controls and it worked well for me. You be increasing the amount of work the web server has to do so if you can you will want to cache the data that is used to update the page.
1

What you're talking about is a 'push' notification, where the server would pass a notification to the client (a browser) without the client requesting anything.

This isnt something which HTTP is naturally capable of, however have a read about Comet - this will let you know the current state of what is possible.

You may opt for creating a 'heartbeat' on the client side - a polling mechanism which requests from the server every x seconds, and updates the page when new content is found.

Comments

1

I need a clean and efficient way to show the admin the requests instantly and for the user to see the admin's response instantly.

Instantly is a very strong term and isn't usually very scalable.

For some ideas on how you might implement this I'd recommend you take a look at Wikipedia's Comet Programming page

3 Comments

Well it's an expression anybody would use if he don't know anything and want the best! :) .. and hopfully through this question I will get a better idea about this. Thanks for the article of course, I'll try to read it and give you my feedback
Kaleb, I'm not just taking the easy way but what if I implemented an auto refresh on both pages like every 1 or 2 secs! is this is a good way to implement my idea ? and also can I let it partially refresh so I could give the cx the Ajax experience ?
Auto-refresh of a certain area of the site every couple of seconds, a la Ajax, is certainly viable.
0

When a user submit requests I assume that his request is first stored in the database. So on the admin & user part you use ajax which periodically update data from database (for un-approved data), do some google search on ajax auto-update or Javascript's timeout or similar function. The same process will be involved in user part.

1 Comment

Thanks for the tip Rittwick. I'll google and if I'll reply to you

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.