Wednesday, March 28, 2012

Updating a status label

I have a recently insalled the AJAX Beta 1 and I was wondering if it will enabled me to change a label multiple times in a sub... see the code below.

Protected Sub cmdSubmitUpload_Click(ByVal senderAs Object,ByVal eAs System.EventArgs)Handles cmdSubmitUpload.CliclblUploadStatus.Text ="Saving file on server..."'do the save herelblUploadStatus.Text ="Verifying file..."'call a routine that verifieslblUploadStatus.Text ="File verified."End Sub
I want to change the label and have the user see it change every time.  Is there a way to do this using AJAX?

Hello, the code that you write for an event handler will run on the server when the request is received, and the result of this is one and only one response that will update the page. If you want to provide this kind of feedback, you would need to write more client side code that executes each part of your process separately and can update the label before each step. You can seach msdn for a Whidbey feature called CallBacks that will allow you to do this, or you can make use of Atlas ability to call webservices from script.

Hope this helps,
Federico

No comments:

Post a Comment