Issues with RegularExpressionValidator in VB .NET 2005 using ASP File Uploader

Posted by JFV on Stack Overflow See other posts from Stack Overflow or by JFV
Published on 2010-12-22T14:19:44Z Indexed on 2010/12/22 15:54 UTC
Read the original article Hit count: 307

I'm looking to validate a single word: detail (upper/lower/mix-case) prior to submitting my VB .NET 2005 page. I used Regex Builder and the below code validates, but it's not working in my web page... Does anyone have any ideas?

        Input file location:
    <input id="btnBrowseForFile" runat="server" enableviewstate="true" name="btnBrowseForFile"
        style="width: 500px" type="file" />
    <asp:RequiredFieldValidator ID="RequiredFieldValidator2"
            runat="server" ControlToValidate="btnBrowseForFile" ErrorMessage="*Please select an input file." Display="Dynamic"></asp:RequiredFieldValidator>
    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="btnBrowseForFile"
        Display="Dynamic" ErrorMessage='*Please select a file that contains the word "detail"'
        ValidationExpression="(\b|\s|\w)(d|D)(e|E)(t|T)(a|A)(i|I)(l|L)(\s|\b|\w)"></asp:RegularExpressionValidator>&nbsp;

Thanks!!! JFV

© Stack Overflow or respective owner

Related posts about .NET

Related posts about ASP.NET