How to cause a page to poatback automatically without user interfering?

C

charles

Hi:

I created a thread from Page_Load to start an infinite loop to monitor
the arrived data (a customized event). When the data arrives, I set a
flag to true to break the loop and join the thread to the Page thread
in order to display the data on a textbox.

Then I want to continue monitoring the arriving data. I use a timer in
which I reset the flag to false and re-start the thread inside the
Page_Load while IsPostback == true.

I can click a button to get into IsPostback == true inside Page_Load
routine. But this needs to be done automatically (with no human
operation).

How to do that? Please teach me. Thanks!

Charles
3/6
 
C

charles

I made it working by adding the following tag inside <HEAD></HEAD>:

<meta http-equiv="Refresh" content="2,
url=http://localhost/......">

This will refresh (not postback) every 2 seconds. But I don't know how
to refresh ONLY when needed (not every 2 seconds). Hope somebody will
help.

If dragging a component timer to the form, its event-handler will be in
a different thread. Don't know how to switch controls between it and
the page thread.

Charles
4/4
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,829
Latest member
PIXThurman

Latest Threads

Top