Write a ValidationExpression of asp:RegularExpressionValidator for uploading the images
I wanted to upload images (Jpgs and Gifs) only so what is the ValidationExpression of asp:RegularExpressionValidator for uploading the images.
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.


Puran KaushalRank #2,456 · 573 reputationPosted Jun 10, 2009, 3:24 AM EDT
in a RegularExpressionValidator. The only problem was with the string
case. I didn't find a way to specify that the regular expression is case
insensitive for the RegularExpressionValidator. The expression can be
rewritten to
^.+\.(([jJ][pP][eE]?[gG])|([gG][iI][fF]))$
to allow extensions like jPeG etc