Validator does'nt work!

  • Thread starter Thread starter Arjen
  • Start date Start date
A

Arjen

Hello,

Here is my file input field:
<INPUT id="ImageFileUpload" style="WIDTH: 353px" type="file"
name="XmlFileUpload" runat="server" width="300" cssclass="NormalTextBox">

Here is my validator:
<asp:RequiredFieldValidator Display="Static" id="RequiredSrc" runat="server"
ControlToValidate="ImageFileUpload" CssClass="NormalRed" />

I select a file and the validator comes with the error messeage.
Why??? It only should do the when there is no file selected!

Can somebody help me?

Thanks!
 
I believe

<asp:RequiredFieldValidator

will only work with an

<asp:TextBox

and not your HTML <Input

This is also because you can use the validator in code-behind.

-Leeor
 
Back
Top