<%@ Page Title="File Extensions" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" %>
<%@ Register Assembly="AjaxUploader" Namespace="AjaxUploader.Controls" TagPrefix="au" %>

<asp:Content ID="TitleContent" ContentPlaceHolderID="TitleContent" runat="server">File Extensions - AjaxUploader v5.0 Demos</asp:Content>
<asp:Content ID="HeaderContent" ContentPlaceHolderID="HeaderTitle" runat="server">File Extension Validation</asp:Content>

<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">

<div class="demo-card">
    <div class="demo-card-header">File Extension Validation</div>
    <div class="demo-card-body">
        <p class="demo-description">
            Restrict uploads to specific file types using <code>AllowedExtensions</code>. Only files
            with matching extensions will be accepted. Files that don't match are rejected with a message.
        </p>

        <h6>Images Only (.jpg, .png, .gif)</h6>
        <au:AjaxFileUpload ID="Uploader1" runat="server"
            AllowedExtensions=".jpg,.png,.gif"
            ButtonText="Select Image"
            AutoUpload="true"
            ShowProgress="true" />

        <div class="code-panel">
            <pre><code>&lt;%@ Register Assembly="AjaxUploader" Namespace="AjaxUploader.Controls" TagPrefix="au" %&gt;

&lt;au:AjaxFileUpload ID="Uploader1" runat="server"
    AllowedExtensions=".jpg,.png,.gif"
    ButtonText="Select Image"
    AutoUpload="true"
    ShowProgress="true" /&gt;</code></pre>
        </div>

        <p class="mt-3 text-muted">
            Try selecting a <code>.txt</code> or <code>.pdf</code> file to see the validation error.
        </p>
    </div>
</div>

</asp:Content>
