INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

asp.net Updating label or textbox text at runtime

asp.net Updating label or textbox text at runtime

(OP)
I've been struggling with this for quite a while. I've looked at several developers' forums but no one can provide what to do.

I have an ASP.NET website written in VB
I have a "Create file" button on the page.
When the button is clicked and right before the click event starts to do its thing, I want to update a TextBox with the start time of the run and clear out the StopTime and ElapsedTime text boxes.
Fortunately, I don't have an issue with updating any textboxes once the file is created, but I can't seem to update the initial values so the user sees it right away.

It's almost like I need some kind of entity that will work immediately, but for the life of me I can't figure it out. All the examples I see make use of an UpdatePanel and UpdateProgress code set that will make an image visible during the file creation. I've added that to my page so at least the user knows that something is happening and that he did click the button. Now if I could only populate the textboxes.

Thanks in advance,
Jerruy

Jerry Scannell

RE: asp.net Updating label or textbox text at runtime


Even though you are using the Updatepanel, you'll have to use javascript to update the text box at the client prior to the post back using the PageRequestManager. You can update the textbox from the code-behind, but you will be setting it to the server time rather than the client time, which depending on your situation, may differ greatly.

CODE

var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_initializeRequest(InitializeRequest);
prm.add_endRequest(EndRequest);
function InitializeRequest(sender, args) 
  {
    // update textbook with current time
  }
function EndRequest(sender, args) 
  {
    // update textbook with current time
  } 


Mark

"You guys pair up in groups of three, then line up in a circle."
- Bill Peterson, a Florida State football coach

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close