AsynUpload FileName display modification

Thread is closed for posting
4 posts, 0 answers
  1. Sumanth
    Sumanth avatar
    3 posts
    Member since:
    Oct 2012

    Posted 31 Oct 2012 Link to this post

    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
  2. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 02 Nov 2012 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Sumanth
    Sumanth avatar
    3 posts
    Member since:
    Oct 2012

    Posted 05 Nov 2012 Link to this post

    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.
  5. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 07 Nov 2012 Link to this post

    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.
Back to Top