When I include the Regular Expression Validator (REV), the page does not respond to insert a new record into a database. The REV is to validate the file uploaded is an image in jpg or png format

When I remove the REV, it processes the data on the server side

    <asp:FileUpload ID="ImageFileUpload" runat="server" />
        ErrorMessage='Please upload an image file of type "jpg" or "png"'
        runat="server" >
        ErrorMessage='Image file must be in \"jpg\" or \"png\" format'
        ValidationExpression ="(?i)^.+(.jpg|.png)$"

    <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert" Text="Insert" OnClick="InsertButton_Click" />
    &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" />

I'm expecting for the validation to run, but it does not respond to click

0 Answers