Telerik is a leading vendor of ASP.NET AJAX, ASP.NET MVC, Silverlight, WinForms and WPF controls and components, as well as .NET Reporting, .NET ORM , .NET CMS, Code Analysis, Mocking, Team Productivity and Automated Testing Tools. Building on its expertise in interface development and Microsoft technologies, Telerik helps customers build applications with unparalleled richness, responsiveness and interactivity. Telerik products help thousands of companies to be more productive and deliver reliable applications under budget and on time.
Version Q2 2011 released 07/12/2011
select

FileExplorer / File Selector Dialog

How to open the 'Explorer.aspx' file:

This demo contains 1 or more dialog pages. To view them, click on the dropdown button (image) next to the corresponding file type.
Select a file:

Open the dialog and double click on a file to select it.

  • File Selector Dialog

    The example above shows how to create a simple File Selector Dialog. On Open button click a RadWindow containing a RadFileExplorer control is displayed. Once the user browses to a file and double clicks on it, the OnClientFileOpen event is fired and the selected file path is populated in the RadTextBox declared on the parent page.

Source Code

C# VB.NET
Show code in new window Demo isolation steps
  • <%@ Page Language="vb" AutoEventWireup="true" CodeFile="DefaultVB.aspx.vb" Inherits="Telerik.Web.Examples.FileExplorer.Dialogues.DefaultVB" %>

    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <%@ Register TagPrefix="telerik" Namespace="Telerik.QuickStart" %>
    <%@ Register TagPrefix="qsf" TagName="Header" Src="~/Common/Header.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="Footer" Src="~/Common/Footer.ascx" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <qsf:HeadTag runat="server" ID="Headtag1"></qsf:HeadTag>
    </head>
    <body class="BODY">
        <form id="form1" runat="server">
        <qsf:Header ID="Header1" runat="server" NavigationLanguage="VB" OnSkinChanged="Header1_SkinChanged" />
        <telerik:RadScriptManager ID="ScriptManager1" runat="server">
        </telerik:RadScriptManager>
        <telerik:RadFormDecorator runat="server" ID="RadFormDecorator1" DecoratedControls="All" />
        <telerik:InformationBox ID="InformationBox1" runat="server" Title="How to open the 'Explorer.aspx' file:">
            <span style="color: Red;font-size:12px;">This demo contains 1 or more dialog pages. To view them, click on the dropdown button (image) next to the corresponding file type.</span>
        </telerik:InformationBox>
        <div>
            Select a file:
            <telerik:RadTextBox ID="fileName" runat="server" Width="350px">
            </telerik:RadTextBox>
    <asp:Button ID="selectFile" OnClientClick="OpenFileExplorerDialog(); return false;"
    Text="Open..." runat="server" />

            <br />
            <br />
            Open the dialog and double click on a file to select it.
        </div>
        <script type="text/javascript">
            function OpenFileExplorerDialog()
            {
                var wnd = $find("<%= ExplorerWindow.ClientID %>");
                wnd.show();
            }

            //This function is called from a code declared on the Explorer.aspx page
            function OnFileSelected(fileSelected)
            {
                var textbox = $find("<%= fileName.ClientID %>");
                textbox.set_value(fileSelected);
            }
        </script>
        <telerik:RadWindow runat="server" Width="550px" Height="560px" VisibleStatusbar="false"
            ShowContentDuringLoad="false" NavigateUrl="Explorer.aspx" ID="ExplorerWindow"
            Modal="true" Behaviors="Close,Move">
        </telerik:RadWindow>
        <qsf:Footer runat="server" ID="Footer1" />
        </form>
    </body>
    </html>

Get more than expected!

 
 

Take your time to truly experience the power of RadControls for ASP.NET AJAX with a free 60-day trial backed up by Telerik’s unlimited dedicated support.

Download your RadControls for ASP.NET AJAX trial and jumpstart your development with the available Getting Started resources.

If you have any questions, do not hesitate to contact us at sales@telerik.com.

Copyright 2002-2024 © Telerik. All right reserved
Telerik Inc, 201 Jones Rd, Waltham, MA 02451