refresh display on event

G

Guest

I am using asp.net 2003/ visual c# 2003.
I have a timer event that sets a value assigned to a text box. With the
debugger, I can tell the event is being executed but the screen is not being
activated:
=========
private void timer1_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
x = "timed event";
Text = x;
Text1.Value = x;
}
=================
In the same application is a button-click event that does work:
===========
private void Button1_Click(object sender, System.EventArgs e)
{
x = Text;
if ( x != "Hello" )
x="Hello";
else
x="Bye";
Text = x;
Text1.Value = x;
}
================

So how do I get the timer event to cause the display in the browser to update?
 
C

Curt_C [MVP]

Boyd said:
So how do I get the timer event to cause the display in the browser to update?

Are you trying to do a clientside fill or a serverpostback and then
fill? It sounds like you are mixing the two up.
 
L

Lucas Tam

So how do I get the timer event to cause the display in the browser to
update?

Web applications unlike a windows form application can't have their display
updated by a timer (unless it is during the request/page generation).

Events have to fire and complete during the request/generation of the page.
After a page is sent to the user, the page is diposed on the server.
 
G

Grant Merwitz

You can not do this Server Side,.

As ASP is request/Response based, it cannot push functionality onto the
Client without a request or client side script.

Solution:
Make a JavaScript time that can do this
or even easier
use a meta tag that refreshes the page every specified time
 

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

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top