Link to home
Start Free TrialLog in
Avatar of mainrotor
mainrotor

asked on

I need help using a validation control in ASP.Net 3.5

Hi Experts,
I use a FileUpload control in my ASP.Net 3.5 application with vb.net codebehind.  I want to make sure that the file the user selects in the FileUpload control has the word ANNAUL and also the Word REPORT in it.  How can I use a Validation control to make sure that this is the case?

Thanks in advance,
mrotor.
Avatar of kaufmed
kaufmed
Flag of United States of America image

Try this one:
<asp:RegularExpressionValidator ID="RegularExpressionValidator1"
                                ControlToValidate="FileUpload1"
                                runat="server"
                                ErrorMessage="RegularExpressionValidator"
                                ValidationExpression="^(?=.*?ANNUAL)(?=.*?REPORT).*$" />

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Moiz Saifuddin
Moiz Saifuddin

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial