How do I refresh a text box in a .aspx code behind project?

  • Thread starter Thread starter Bryan G
  • Start date Start date
B

Bryan G

I have a timmer that looks at a value in a text box that I need to get
refreshed How do I refresh the text box?

thanks,
BG
 
Bryan,

The short answer; you can't. The long answer is still that you can't do
this from code behind since there is only an open connection between the
client (web browser) and server (webserver) for the duration of the
Request/Response calls.

You would have to rely on some client side script, like javascript, and set
up a timer (look at the setIntervall call in javascript) and force a form
submit
when the timer triggers. On the server side you would catch it by checking
for Page.IsPostBack in the Page_Load event. Once here, you can change
the value of your textbox using textBoxName.Text = "Sometext";

HTH,

//Andreas
 
Back
Top