Solved

ASP.NET refresh on event (timer or COM)

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Developer tools in browsers have been around for a while, yet they are still heavily underused by developers. Developers still fix html or CSS then refresh page to see effect, or they put alert or debugger in JavaScript and then try again and again …
A publishing tool, a Version Control System, or a Collaboration Platform! These can be some of the defining words for the two very famous web-hosting Git repositories: Bitbucket and Github. Git is widely used amongst the programmers and developers f…
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…
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…

914 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

20 Experts available now in Live!

Get 1:1 Help Now