Whenever we use fileupload control on web pages , the common requirement is to validate its file type and size.
Above code explain itself a lot so no need to discuss further on it.
Here is the html markup that shows controls on the page :
<form id="form1" runat="server"> <div> <asp:FileUpload ID="FileUpload1" runat="server" /> <asp:Button ID="Button1" runat="server" Text="Upload" OnClientClick="return FileTypeValidate();" /> </div> </form>
This is very simple but very common scenario for the web applications & very effective if managed properly…
Thats it, hope this will help !!!