I done my logincontrol project in c# using asp.net2.0. it is accepting spaces in username textbox which i don't want.It should not accept any spaces before entering text.please give solution.

11 Years
Discussion Span
Last Post by jbennet

i seem to have lost the .NET code but this may be of help - here is some VB6 code that gets you to enter your name and then spilits it

e.g if you inout "James Bennet" it says:

Firstname = James
Lastname = Bennet

Private Sub Command1_Click()
Dim length As Integer
Dim name As String
Dim Firstname As String
Dim LastName As String
Dim x As Integer
    name = InputBox("What is your name")
length = Len(name)
x = InStr(name, " ")
Firstname = Left(name, x)
LastName = Right(name, length - x)
    MsgBox "The first is " & Firstname
    MsgBox "The last name is " & LastName
End Sub

you could use something like this on your password program to discard anything after the space

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.