3
Answers

Validation for FileUpload control

Joma Alrzini

Joma Alrzini

8y
265
1
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)