Author: neha.rhia | Posted on: 4/4/2009 7:40:11 AM | Views : 539

Hi everyone...

I'm trying to validate the textbox controls in my form, but seems not to get it right

Validate:

txtEmpId - The ID must start with the letter "B" and the length must be equal to 6 ( not more or less)


txtPwd - The password must be at least 6 chars long ( not more or less) and the password should not contain space " "

As for the rest I used server side validation, like to check for empty field I did the following


If txtEmpID.Text.Trim = "" Or txtFirstName.Text.Trim = "" Or
txtLastName.Text.Trim = "" Or txtEmail.Text.Trim = "" Or
txtPwd.Text.Trim = "" Then

   lblErrorMessage.Text = "Please fill in the required fields."

...........

For dropdownlsit I used RequiredFieldValidator control
 
Problem:

When the page loads, I clicked on btnAdd (whi ...

Go to the complete details ...