1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Question about Registration Information Validation

Discussion in 'C#' started by Flyers8985, Feb 27, 2008.

  1. #1
    Hello, first off want to take the time to thank anyone that reads this. I'm new to .NET/Java Script/AJAX so I'm sort of at a crossroads here for the most logical way to approach what I am trying to do.

    I have a registration page with these required fields. E-mail, Confirm e-mail, Date of Birth, Gender, Country, Alias, Password, and Confirm Password.

    What I am looking to do is make sure the e-mail is valid (has @xxx.yyy), compare the confirm e-mail and e-mail to make sure they match. I just want to make sure that Date of Birth, Gender and Country have information in them. Lastly I want to compare the user name to a table of 'banned words', and then lastly just make sure the two password fields match.

    I'm just really stuck as to the most logical and efficient way of doing this. I've been searching for things on google but nothing has come up that made he light bulb go off in my head.

    Any help is appreciated, and once again thanks for taking your time to look at this.

    -Flyers885
     
    Flyers8985, Feb 27, 2008 IP
  2. JohnZing

    JohnZing Peon

    Messages:
    109
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    just use asp.net validatores
     
    JohnZing, Feb 27, 2008 IP
  3. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #3
    for all but the banned words use the appropriate .net validators as JZ says.

    For banned words you will need to use a custom validator and write a serverside check on if the textbox contains your unwanted words. A basic example would be:
    Protected Sub CV1_ServerValidate(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs)
            If textbox1.Text.Contains("poo") Then
                args.IsValid = False
            Else
                args.IsValid = True
            End If
    End Sub
    Code (VB.Net):
     
    AstarothSolutions, Feb 27, 2008 IP
  4. webrehash

    webrehash Peon

    Messages:
    163
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #4
    webrehash, Mar 1, 2008 IP
  5. Flyers8985

    Flyers8985 Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Appreciate all the replies. I looked into it and got it done.

    Thanks to everyone who posted. :)
     
    Flyers8985, Mar 3, 2008 IP