用正则表达式验证控件过滤fileupload控件上传文件类型收藏
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="FileUpload1"
ErrorMessage="必须是 jpg或者gif文件" ValidationExpression="^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))+(.jpg|.Jpg|.gif|.Gif)$"></asp:RegularExpressionValidator>
ErrorMessage="必须是 jpg或者gif文件" ValidationExpression="^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))+(.jpg|.Jpg|.gif|.Gif)$"></asp:RegularExpressionValidator>