Validate Extension Of Selected File In File Uploader Before Uploading in Asp .Net C#Using RegularExpressionValidator ..
<asp:FileUpload ID="fuParon" runat="server" />
<asp:RegularExpressionValidator id="RegularExpressionValidator1" runat="server"
ErrorMessage="Only Excel file is allowed!"
ValidationExpression ="^.+(.xls|.xlsx)$" ControlToValidate="fuParon"
style="color: #FF5050" ValidationGroup="upload" ></asp:RegularExpressionValidator>
<asp:ImageButton ID="BtnUpload" runat="server" ImageUrl="uploadimage.png" Width=30px Height=30px ValidationGroup="upload" />
<asp:FileUpload ID="fuParon" runat="server" />
<asp:RegularExpressionValidator id="RegularExpressionValidator1" runat="server"
ErrorMessage="Only Excel file is allowed!"
ValidationExpression ="^.+(.xls|.xlsx)$" ControlToValidate="fuParon"
style="color: #FF5050" ValidationGroup="upload" ></asp:RegularExpressionValidator>
<asp:ImageButton ID="BtnUpload" runat="server" ImageUrl="uploadimage.png" Width=30px Height=30px ValidationGroup="upload" />
No comments:
Post a Comment