Change target folder client side?

2 posts, 0 answers
  1. Mathew
    Mathew avatar
    27 posts
    Member since:
    Jul 2011

    Posted 31 Aug 2012 Link to this post


    Is it possible to change the target folder from the client side?  I have a combobox with a list of possible folders, and when the selection is changed, I want to change the target folder for the upload.

    function OnClientSelectedIndexChanged(sender, eventArgs) {
          var item = eventArgs.get_item();
          var upload = $find("<%= RadAsyncUpload1.ClientID %>");
          upload.TargetPath = ???
          alert("You selected " + item.get_text());

    Alternatively, is it possible to do this on the server side before the files are moved from the temporary directory to the target directory?  I can obviously change the value in a postback, but the upload appears to be happening before my event is called.

    Any help would be appreciated.

  2. Plamen
    Plamen avatar
    2723 posts

    Posted 05 Sep 2012 Link to this post

    Hi Mathew,

    One way to achieve this scenario is to use the PostbackTriggers property of RadAsyncUpload that determines which Postback will upload the files. I am attaching a sample test project that reproduces it.

    Hope this will be helpful.

    Kind regards,
    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. DevCraft R3 2016 release webinar banner
Back to Top