Validator does'nt work!

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!
 
L

Leeor Geva

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top