Validator does'nt work!

Discussion in 'ASP .Net' started by Arjen, Aug 1, 2003.

  1. Arjen

    Arjen Guest

    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!
    Arjen, Aug 1, 2003
    #1
    1. Advertising

  2. Arjen

    Leeor Geva Guest

    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

    "Arjen" <> wrote in message
    news:bgemu1$j40$1.nb.home.nl...
    > 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!
    >
    >
    Leeor Geva, Aug 2, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joey
    Replies:
    3
    Views:
    3,005
  2. TB
    Replies:
    2
    Views:
    3,709
  3. Luigi Donatello Asero

    The validator does not work

    Luigi Donatello Asero, Sep 23, 2005, in forum: HTML
    Replies:
    21
    Views:
    939
    Stewart Gordon
    Sep 28, 2005
  4. Luigi Donatello Asero

    Re: The validator does not work

    Luigi Donatello Asero, Sep 23, 2005, in forum: HTML
    Replies:
    0
    Views:
    358
    Luigi Donatello Asero
    Sep 23, 2005
  5. Replies:
    4
    Views:
    888
    Richter~9.6
    Feb 13, 2007
Loading...

Share This Page