Joma Alrzini

Joma Alrzini

  • NA
  • 61
  • 30.6k

Validation for FileUpload control

Jul 4 2016 7:24 AM
I need to make validation message for file upload when a user click on the button without uploading file the error message appears
This the code I have tried but it is not working
 
 

<asp:FileUpload ID="FileUpload1" runat="server" Width="200px" OnLoad="FileUpload1_Load" />

<span runat="server" style="color: red; font-size: 20px">*</span>

<asp:RequiredFieldValidator ErrorMessage="Video title is a required field."

ID="RequiredFieldValidator11" ForeColor="Red" ControlToValidate="FileUpload1"

runat="server" ValidationGroup="click" SetFocusOnError="true" />


Please help  

Answers (3)