Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Validating with out Validators

Validating with out Validators

Scheduled Pinned Locked Moved ASP.NET
regextutorialquestion
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Muntyness
    wrote on last edited by
    #1

    Hi all, I have a number of text boxes that the user can fill in. I want to make sure that the user can only use the following characters: . + - _ ( ) A-Z a-z 0-9 Unfortunately asp:validators are not working. (And I don't know why, as they used to work before importing the project from vs2003 to vs2005. Plus I don't know how to set this in the validators anyway...) I'm guessing that regular expressions are the way to go in this case (using Regex.Match(inputString, Pattern), but I don't know how to make a working regular expression. (The patterns I've been trying have ended up crashing when I include a character such a # or ' at the end of the input string.) So, any suggestions? - Munty

    C 1 Reply Last reply
    0
    • M Muntyness

      Hi all, I have a number of text boxes that the user can fill in. I want to make sure that the user can only use the following characters: . + - _ ( ) A-Z a-z 0-9 Unfortunately asp:validators are not working. (And I don't know why, as they used to work before importing the project from vs2003 to vs2005. Plus I don't know how to set this in the validators anyway...) I'm guessing that regular expressions are the way to go in this case (using Regex.Match(inputString, Pattern), but I don't know how to make a working regular expression. (The patterns I've been trying have ended up crashing when I include a character such a # or ' at the end of the input string.) So, any suggestions? - Munty

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Muntyness wrote:

      Plus I don't know how to set this in the validators anyway...)

      How can you know they are not working, if you don't know how to use them ? A validator validates AFTER text is entered, so you could use a regex validator, but your box will still accept other characters. www.expresso.com[^], or search this site for Expresso, a tool for building regex. But, if you want to not allow those keypresses at all, you need to write javascript code that does that directly.

      Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      M 1 Reply Last reply
      0
      • C Christian Graus

        Muntyness wrote:

        Plus I don't know how to set this in the validators anyway...)

        How can you know they are not working, if you don't know how to use them ? A validator validates AFTER text is entered, so you could use a regex validator, but your box will still accept other characters. www.expresso.com[^], or search this site for Expresso, a tool for building regex. But, if you want to not allow those keypresses at all, you need to write javascript code that does that directly.

        Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

        M Offline
        M Offline
        Muntyness
        wrote on last edited by
        #3

        Because the validators I do know how to use are no longer working. So far I've tries two different types of validators that used to work under 2003. This bit I don't know how to do via asp validators is limiting the accepted character sets. Thanks for the Expresso comment. I'll try that out. (The link you point to leads to a parked domain, but I was able to find it here) - Munty

        P 1 Reply Last reply
        0
        • M Muntyness

          Because the validators I do know how to use are no longer working. So far I've tries two different types of validators that used to work under 2003. This bit I don't know how to do via asp validators is limiting the accepted character sets. Thanks for the Expresso comment. I'll try that out. (The link you point to leads to a parked domain, but I was able to find it here) - Munty

          P Offline
          P Offline
          Priya_2007
          wrote on last edited by
          #4

          Can u please giv me the code related to validations of a control in ASP.Net 2.0

          Priya

          L 1 Reply Last reply
          0
          • P Priya_2007

            Can u please giv me the code related to validations of a control in ASP.Net 2.0

            Priya

            L Offline
            L Offline
            Lucky Sheikh
            wrote on last edited by
            #5

            hey baby r u new in .net there are already validators in asp.net dont write any query. go to validation controls or data validator n drag n drop it will work of byeeeeeeee:laugh: lucky

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups