Contact Form

Name

Email *

Message *

Adding Filter Action Regular Expression to FileUpload Control of ASP.NET

No comments



<div>
        <asp:FileUpload ID="FileUpload1" runat="server" />
        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
                   ControlToValidate="fileupload1"
                   ErrorMessage="Only .jpg,.png,.jpeg,.gif Files are allowed" 
  ForeColor="Red"
                   ValidationExpression="(.*?)\.(jpg|jpeg|png|gif|JPG|JPEG|PNG|GIF)$"></asp:RegularExpressionValidator>
                   <asp:button ID="Button1" runat="server" text="Button" 
             />
    </div>

No comments :

Post a Comment