Adding folders dynamically on upload button

2 posts, 0 answers
  1. Bilawal
    Bilawal avatar
    1 posts
    Member since:
    Jul 2012

    Posted 10 Jan 2013 Link to this post

    hi everyone, i am new to telerik controls, i have a rad file explorer, code of my explorer is below

     <table cellspacing="4">
            <tr>
                <td rowspan="2" style="vertical-align: top;">
                    Browse to an image and double click to preview.
                    <telerik:RadFileExplorer runat="server" ID="FileExplorer2" Width="520px" Height="520px"
                        OnClientItemSelected="OnClientItemSelected" 
                        OnClientDelete="OnClientDelete"                     
                        EnableAsyncUpload="True" 
                       >
                        <Configuration ViewPaths="~/Images" UploadPaths="~/Images"
                            DeletePaths="~/Images"></Configuration>
                    </telerik:RadFileExplorer>
                </td>
                <td>
                    <div id="decoratedZoneFiledset">
                        <fieldset style="width: 230px; height: 220px; margin-top: 14px;">
                            <legend>Preview</legend>
                            <img id="pvwImage" src="Images/Northwind/Flowers/Flower1.jpg" alt="Flower1.jpg"
                                style="display: none; margin: 10px; width: 200px; height: 180px; vertical-align: middle;" />
                        </fieldset>
                    </div>
                </td>
            </tr>
            <tr>
                <td valign="top" id="decoratorZone">
                   
                    <asp:Button ID="Button1" runat="server" Text="Submit" />
                </td>
            </tr>
        </table>
    i give uploadpath,viewpath, deletepath initially temperary as the upload button should appear,
    i want this, when i click on upload button in code behind i want setting a path from my controls like dropdown.selectedvalue/textbox/imgname how i get this, any help will be appreciated. 
    thanks in advance :)
  2. Vessy
    Admin
    Vessy avatar
    1389 posts

    Posted 15 Jan 2013 Link to this post

    Hi Bilawal,

    If I understand the scenario correctly, you want to add dynamically folders to the FileExplorer's UploadPaths. You should note that the latest moment of the page live cycle where the RadFileExplorer's properties ViewPaths / DeletePaths / UploadPaths can be set is the Page_Load event, and Button_Click event occurs after that. Nevertheless, your scenario can be implemented using the following approach approach:
    • You need to check which control causes Postback
    • Then, change the paths based on the clicked button. Please note that you need to clear the old nodes in order to force the RadFileExplorer to repopulate its content.

    For your convenience I have attache a sample project implementing the above mentioned approach, including a RadComboBox in the ToolBar of FileExplorer.


    Kind regards,
    Vesi
    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
Back to Top