开发者

ASP.NET how to update a page upon a click event of another page

开发者 https://www.devze.com 2023-04-12 16:43 出处:网络
I know the question sounds too vague so let me explain exactly what I want to implement. I have a WebApplication th开发者_运维百科at many users log into to submit a request, Request in my project is

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

I have a WebApplication th开发者_运维百科at 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 :)


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/.


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/


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.


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号