This is a migrated thread and some comments may be shown as answers.

AsynUpload FileName display modification

3 Answers 53 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Sumanth
Top achievements
Rank 1
Sumanth asked on 31 Oct 2012, 10:58 AM
Hi

I am using RadAsyncUpload control, with postbacktriggers to persist the uploaded file data temporarily. I would like to modify the filename of the uploaded file that is displayed to the User. So currently, I did the modification using "OnClientFileuploaded " event, and I am changing the Text in the html through javascript. 

But, the problem comes when some postback happens, my changes to the file name that are made through the "OnClientFileUploaded" event are reverted, and now user is shown with actual filename of the uploaded file.

How do I resolve this issue? I would like to have some event, when the RadAsyncontrol is trying to repopulate the persisted data after some postback. Is there any such event or some place where I can handle the display of filename.

Thanks
Sumanth

3 Answers, 1 is accepted

Sort by
0
Peter Filipov
Telerik team
answered on 02 Nov 2012, 10:53 AM
Hello Sumanth,

The event that you could use is OnClientAdded. I prepared a sample project for you. Please review the attachment.

Regards,
Peter Filipov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Sumanth
Top achievements
Rank 1
answered on 05 Nov 2012, 08:20 AM
OnClientAdded event did not solve my problem. This event is being called only the first time control is added.(not again when the postback event happened from the controls other than the ones declared in PostbackTriggers.

Below is how my RadAsyncUpload control is defined.

<telerik:RadAsyncUpload runat="server" ID="rdUpload1" MultipleFileSelection="Disabled" ControlObjectsVisibility="None"  MaxFileInputsCount="1" OnClientFileUploaded="fileUploaded" p ostbackTriggers="ImgAcceptButton,ImgCancelButton"> 

In OnClientFileUploaded event, I am changing the text of the filename that is displayed after successful upload. Now, when some postback happens, filename text that is modified earlier is reverted and comes back to the original state.

Please refer to the attached jpeg to understand better wherever applicable.

This is what I would like to handle, so that I can reapply the changes when it is reverted, or save the state without reverting. Please help me with the same.
0
Peter Filipov
Telerik team
answered on 07 Nov 2012, 09:36 AM
Hi Sumanth,

I modified the project and now it is working correct when the MaxFileInputs=1. Please use the pageLoad event instead OnClientAdded. I am send you the sample project updated.

Regards,
Peter Filipov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Upload (Obsolete)
Asked by
Sumanth
Top achievements
Rank 1
Answers by
Peter Filipov
Telerik team
Sumanth
Top achievements
Rank 1
Share this question
or