peebman2000
Programmer
Hello everyone, I have using the regular expression validator for an app to only upload .txt files only. When I run the app and I choose file other than .txt file it shows my validation error, but when I choose a .txt file also it still shows my validation error. It basically shows the validation error no matter what file I choose, i want it to only show the validation error when choosing non .txt files. Here is my code below, does anyone know why the valdation error continues to show up, no matter what file I select?
<asp:RegularExpressionValidator ID="FileUploadValidator" runat="server" ControlToValidate="FileUpload1"
ErrorMessage="Upload .Txt files only." Style="z-index: 104; left: 551px; position: absolute;
top: 125px" ValidationExpression='"^(([a-zA-Z]
|(\\{2}\w+)\$?)(\\(\w[\w].*))(.txt|.TXT)$"'></asp:RegularExpressionValidator>
<asp:RegularExpressionValidator ID="FileUploadValidator" runat="server" ControlToValidate="FileUpload1"
ErrorMessage="Upload .Txt files only." Style="z-index: 104; left: 551px; position: absolute;
top: 125px" ValidationExpression='"^(([a-zA-Z]