Solved

ASP.NET refresh on event (timer or COM)

Posted on 2007-04-11
2
622 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…

828 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