Last post Feb 15, 2012 01:05 AM by FutureGuru
Oct 13, 2009 06:23 PM|Calvin Nguyen|LINK
As you know, OnClientUploadComplete triggers after a file is successfully uploaded. However, is there a technique to read a response from the server at this point?
Why would I want to do this? Suppose a file is uploaded and saved on the server side. The file could have been a new insert, or it could have overwritten an older version of itself. I'd like the server to tell the client which of these two things happened during
OnClientUploadComplete. Since OnClientUploadComplete presumably is set off only after the server has acknowledged a successful file upload, this should be possible, yeah?
Oct 13, 2009 09:27 PM|Calvin Nguyen|LINK
I resolved this by placing a hidden HTML input control on the page. When the upload completes, I use OnUploadedComplete on the server side to update the value of this hidden control. Then in OnClientUploadComplete I read the value.
Feb 15, 2012 01:05 AM|FutureGuru|LINK
I have more or less the same situation but I open the AsynFileUpload as a user control in a separate window. This separate window gets open by clicking a button from the main page. So my question to all experts is that when the upload is completed i.e. in
this an image has been uploaded and saved on the server
2. but on the main page i want to change the source of image control to this newly uploaded image.
3. I tried to do some thing like
window.parent.document.getElementById('Image1').src = './Images/StudentImages/abc.jpg';
in the uploadComplete(sender, args) event, but then it fires the uploadError(sender) event