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

Clear file path from file upload control inside rad window

1 Answer 89 Views
Window
This is a migrated thread and some comments may be shown as answers.
Venkatesh
Top achievements
Rank 1
Venkatesh asked on 12 May 2015, 09:47 AM

Hi,

I am using a Rad window, which contains a file upload control. I am trying to clear the file path, when the rad window is closed.

Below is the aspx code:

<telerik:RadWindow runat="server" ID="rwUpload" Title="UPLOAD"
 
        RestrictionZoneID="ContentTemplateZone" Width="400px" Modal="true" Behaviors="Close"
 
        VisibleStatusbar="false" MaxHeight="200px" OnClientClose="OnClientClose" ReloadOnShow="true"
 
        ShowContentDuringLoad="false">
 
        <ContentTemplate>
 
            <telerik:RadWindowManager ID="rwmUpload" runat="server" EnableShadow="true">
 
            </telerik:RadWindowManager>
 
            <div style="width: 380px; overflow: hidden" class="contButton">
 
                <table style="margin-left: 30px; top: 30px;" width="340px">
 
                    <br />
 
                    <asp:FileUpload ID="FlupExceFile" Width="300px" runat="server" />
 
                    <br />
 
                    <br />
 
                    <asp:Label ID="lblMessage" ForeColor="red" runat="server"></asp:Label>
 
                </table>
 
                <br />
 
                <table style="margin-left: 30px; vertical-align: bottom;" width="340px">
 
                    <tr valign="bottom">
 
                        <td>
 
                            <telerik:RadButton ID="btnUpload" runat="server" Text="Upload" OnCommand="btnUpload_OnCommand">
 
                            </telerik:RadButton>
 
                        </td>
 
                    </tr>
 
                </table>
 
            </div>
 
        </ContentTemplate>
 
    </telerik:RadWindow>

I want to remove the file path using jquery/javascript when the rad window is closed.

How to achieve this?

Thanks

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 12 May 2015, 10:42 AM

Hi Venkatesh,

You can use the OnClientClose event of the RadWindow: http://www.telerik.com/help/aspnet-ajax/window-client-side-events-onclientclose.html. Here is a basic example that clears the selected path of a FileInput control:

function OnClientClose(sender, args) {
    $get("<%=FlupExceFile.ClientID%>").value = "";
}

On a side note - I recommend that you move the RadWindoManager out of the ContentTemplate of the RadWindow.

Regards,

Marin Bratanov
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
Window
Asked by
Venkatesh
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or