validator controls

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Howard

    validator controls

    I use a regex validator to check if a textbox is in email format. How do I
    make sure zero length input is not accepted? Do I need to use another
    requiredfield validator? or is check zero length built-in to the regex
    validator?


  • Steve C. Orr [MVP, MCSD]

    #2
    Re: validator controls

    Zero length check is not built into the email validator regular expression.
    For this you should use a RequiredFieldVa lidator control.
    There's nothing wrong with using more than one validation control to
    validate a single input control.

    Here's more info:


    --
    I hope this helps,
    Steve C. Orr, MCSD, MVP




    "Howard" <howdy0909@yaho o.com> wrote in message
    news:O%23XtaSBi GHA.3904@TK2MSF TNGP02.phx.gbl. ..[color=blue]
    >I use a regex validator to check if a textbox is in email format. How do I
    >make sure zero length input is not accepted? Do I need to use another
    >requiredfiel d validator? or is check zero length built-in to the regex
    >validator?
    >[/color]


    Comment

    • Howard

      #3
      Re: validator controls

      Thanks Steve
      I have another question about user controls


      According to MSDN
      If I use a user control like this
      <Acme:Login id="MyLogin" UserId="John Doe" runat="server"/>
      In the .cs file I put
      public string UserId = "";
      Then I can reference UserId from my code


      my question is if i have a user control like this
      <Acme:Login id="MyLogin" runat="server"> something</Acme:Login>

      How would I access the text in between the tags?



      "Steve C. Orr [MVP, MCSD]" <Steve@Orr.ne t> wrote in message
      news:uQppG$BiGH A.4304@TK2MSFTN GP05.phx.gbl...[color=blue]
      > Zero length check is not built into the email validator regular
      > expression.
      > For this you should use a RequiredFieldVa lidator control.
      > There's nothing wrong with using more than one validation control to
      > validate a single input control.
      >
      > Here's more info:
      > http://SteveOrr.net/articles/Validation.aspx
      >
      > --
      > I hope this helps,
      > Steve C. Orr, MCSD, MVP
      > http://SteveOrr.net
      >
      >
      >
      > "Howard" <howdy0909@yaho o.com> wrote in message
      > news:O%23XtaSBi GHA.3904@TK2MSF TNGP02.phx.gbl. ..[color=green]
      >>I use a regex validator to check if a textbox is in email format. How do I
      >>make sure zero length input is not accepted? Do I need to use another
      >>requiredfie ld validator? or is check zero length built-in to the regex
      >>validator?
      >>[/color]
      >
      >[/color]


      Comment

      • Steve C. Orr [MVP, MCSD]

        #4
        Re: validator controls

        Many (but not all) controls expose this as their Text property.

        --
        I hope this helps,
        Steve C. Orr, MCSD, MVP



        "Howard" <howdy0909@yaho o.com> wrote in message
        news:uO96KcCiGH A.4896@TK2MSFTN GP05.phx.gbl...[color=blue]
        > Thanks Steve
        > I have another question about user controls
        >
        >
        > According to MSDN
        > If I use a user control like this
        > <Acme:Login id="MyLogin" UserId="John Doe" runat="server"/>
        > In the .cs file I put
        > public string UserId = "";
        > Then I can reference UserId from my code
        >
        >
        > my question is if i have a user control like this
        > <Acme:Login id="MyLogin" runat="server"> something</Acme:Login>
        >
        > How would I access the text in between the tags?
        >
        >
        >
        > "Steve C. Orr [MVP, MCSD]" <Steve@Orr.ne t> wrote in message
        > news:uQppG$BiGH A.4304@TK2MSFTN GP05.phx.gbl...[color=green]
        >> Zero length check is not built into the email validator regular
        >> expression.
        >> For this you should use a RequiredFieldVa lidator control.
        >> There's nothing wrong with using more than one validation control to
        >> validate a single input control.
        >>
        >> Here's more info:
        >> http://SteveOrr.net/articles/Validation.aspx
        >>
        >> --
        >> I hope this helps,
        >> Steve C. Orr, MCSD, MVP
        >> http://SteveOrr.net
        >>
        >>
        >>
        >> "Howard" <howdy0909@yaho o.com> wrote in message
        >> news:O%23XtaSBi GHA.3904@TK2MSF TNGP02.phx.gbl. ..[color=darkred]
        >>>I use a regex validator to check if a textbox is in email format. How do
        >>>I make sure zero length input is not accepted? Do I need to use another
        >>>requiredfiel d validator? or is check zero length built-in to the regex
        >>>validator?
        >>>[/color]
        >>
        >>[/color]
        >
        >[/color]


        Comment

        Working...