当我包含正则表达式验证器(REV)时,页面不响应将新记录插入数据库。 REV用于验证上传的文件是jpg还是png格式的图像
当我删除REV时,它将在服务器端处理数据
<InsertItemTemplate>
<asp:FileUpload ID="ImageFileUpload" runat="server" />
<asp:RequiredFieldValidator
ErrorMessage='Please upload an image file of type "jpg" or "png"'
ControlToValidate="ImageFileUpload"
Text="*"
runat="server" >
</asp:RequiredFieldValidator>
<asp:RegularExpressionValidator
ErrorMessage='Image file must be in \"jpg\" or \"png\" format'
ControlToValidate="ImageFileUpload"
ValidationExpression ="(?i)^.+(.jpg|.png)$"
Text="*"
runat="server">
</asp:RegularExpressionValidator>
<asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert" Text="Insert" OnClick="InsertButton_Click" />
<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" />
</InsertItemTemplate>
我希望验证能够运行,但是它对点击没有响应