Solved

ASP.NET refresh on event (timer or COM)

Posted on 2007-04-11
2
617 Views
Last Modified: 2008-02-01
Hi,

I'm not sure if this is possible but I'm having problems finding a solution :(

I have a website written in asp.net (C#) which connects to a C++ COM server for data which will be retrieved and used to update the webpage. Sending data to the COM server works perfectly.  Retrieving a response and updating the website is the problem.

I'm not sure how this is done professionally but here are the possibilities I've come up with:

- In the asp.net create a timer that on fire checks if there is new data in the COM server to be retrieved i.e simple values, retrieve the data, and send a refresh to update the page.
    - problems - create timer, and issue refresh

- Have a C++ event in the COM server and when triggered by the COM server to state that new data is ready to be retrieved, the asp.net picks up with event, retrieves the data and sends a refresh to update the page.
    - problems - accessing an C++ event in the COM server from asp.net, and issue refresh

Is this viable? If not, is there any alternatives?

Cheers,

Brent.
0
Comment
Question by:Brent-Campbell
2 Comments
 
LVL 21

Accepted Solution

by:
MogalManic earned 250 total points
ID: 18888692
Firstoff, a server cannot refresh a browser.  The HTTP protocol is a disconnected client.  The client only connects to the server.  There is no way for the server to connect to the client.

There are three way's that I see on doing this:
  1) Have a "refresh" button when the user clicks button, then refresh the page
  2) Setup a refresh timeout.  Either through javascript or html
      (http://www.hscripts.com/tutorials/html/autorefresh.php)  after timeout
      expires, automatically refresh the page
  3) Use AJAX to populate page results, periodically "polling" for changes and refreshing
      when results change.

The above options are in order of complexity and improved customer experience.  The 1st two options, will refresh the whole page, but are easier to implement.  Using AJAX would be the best way but might be difficult to implement.
0
 
LVL 6

Expert Comment

by:sara110
ID: 18889710
the best way for you , is using javascript for its timer, or use AJAX that you could retrieve your data and also refresh the page.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

If I have to fix slow responding website my first thoughts are server side optimizations: the database may not be optimized or caching is not enabled, or things like that. We often overlook another major part of our web application: the client. We o…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This video teaches users how to migrate an existing Wordpress website to a new domain.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now