<%@ Page Language="C#" AutoEventWireup="true" CodeFile="UploadProgress.aspx.cs" Inherits="UploadProgress" %>

<%@ Register Assembly="RadUpload.Net2" Namespace="Telerik.WebControls" TagPrefix="radU" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<script>
function Validate(source, arguments)
{
   //Clear the statusLabel
   document.getElementById("statusLabel").innerHTML="";
   //Validate the file extension
   arguments.IsValid = <%= RadUpload1.ClientID %>.ValidateExtensions();
   if (!arguments.IsValid )
     alert("File extension validation failed");
}
</script>

<head runat="server">
    <title>Telerik: RadUpload with RadProgressArea</title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <table>
                <tr>
                    <td>
                        <radU:RadUpload ID="RadUpload1" runat="server" 
                        LocalizationPath="RadControls/Upload//Localization"
                           SkinsPath="~/RadControls/Upload/Skins" 
                           TargetFolder="~/MyUploadedFiles" 
                           AllowedFileExtensions=".zip,.doc,.jpg" 
                           InitialFileInputsCount="3" 
                           OverwriteExistingFiles="True"/>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <asp:Label ID="statusLabel" runat="server"></asp:Label>
                        <asp:Button ID="Button1" runat="server" Text="Upload" OnClick="Button1_Click" />
                    </td>
                </tr>
            </table>
            <asp:CustomValidator ID="CustomValidator1" runat="server" 
                ClientValidationFunction=""
                Display="Dynamic" 
                ErrorMessage="Invalid file extension" 
                OnServerValidate="CustomValidator1_ServerValidate">
            </asp:CustomValidator>
            <radU:RadProgressManager ID="RadProgressManager1" runat="server" />
            <radU:RadProgressArea ID="RadProgressArea1" runat="server" DisplayCancelButton="True">
            </radU:RadProgressArea>
        </div>
    </form>
</body>
</html>
