Saturday, March 31, 2012

submitting the form to the browser

I am very new to ASP.NET. We have an asp.NET project that is used to show the state of various sql tables/data. The "proposed enhancement" to that is when the data is updated locally (through another application running on the same network where the database is located), the browser (if someone happen to view the same data over the Internet through a browser) should refresh automatically so that the data is ~accurate~ when viewed. I know that browser uses pull technology, and in order to receive a new data, the browser must "request" it (through a control-generated event or a refresh event generated through timer). When the form is posted back to the server and resubmitted, it will "refresh" the browser view. Since the data must appear on the browser within 10-20 seconds of the actual data update, the refresh must be done quite frequently, and the page will constantly reload, so because of that I am not eager to generate refresh events on timer. Is there any way I can push the newly updated page to the browser from the server without any interaction/request from the browser? Is anybody aware of any other technology that I can use it to accomplish this task? ANy help/hint/suggestions are greatly appreciated.

Thank you
olaHi ola,

Unfortunately, there is no other technology that will help you with this issue. You are correct in that the brower uses "pull" technology and therefore there is nothing you can do on the server side to initiate this refresh. The only solution is to use client-side script to refresh the borwser.

Chad
Hi ola,

unfortunately a browser only supports the pull way. But maybe this article can be of help to you:Using IE's Web Service Behavior To Create Rich ASP.NET Applications. I know the next version of ASP.NET uses something like client call back functionality that's able to only update small portions of a page without refreshing the whole page.

Of course using this technique still requires to call a method on a time interval.

Grz, Kris.
Chad,

thank you very much for your reply.
I have additional question. When you refer to a client-side script that can be used to refresh a browser, are you talking about a separate program running on the same machine where the browser is open, or it is something incorporated into the web form code that does it on a timely bases? If it was a separate program (which could know which instance of the browser I need to refresh, which form on that instance of the browser is open and how to envoke the refresh on the browser), it would probably work for me. I will just need to find out how to do it (if at all it is possible). Do you know anything about it? Any ideas/suggestions?

Thank you

ola
ola,

I was actually talking about using a JavaScript timer or using the Meta tags to refresh the browser. I think it would be nearly impossible to write a Windows app to know which browser to refresh when. This would be way more work than it's worth. I think your only solution here is to just put code in your page to refresh the entire page every so often. Sorry I don't have the perfect solution for your problem.

Chad

0 comments:

Post a Comment