Introduction

Today I am going to demonstrate a validation trick for a strong password. We often need a strong password as it is became a standard of web to have
Passwords very strong so that nobody can guess it easily. It will be very useful for any registration form.

Background

In this tip I used jQuery.ajax method to call the Validation Method on server side. The idea behind this is to avoid
post back and also it is very light and quick. People who are new to jquery please go through this link.

In this example on the login page there are two input fields User Name and password, our focus in on the Password filed. The validation trick will look
for the input by user. Password must use a combination of these:

Atleast 1 upper case letters (A – Z)

Lower case letters (a – z)

Atleast 1 number (0 – 9)

Atleast 1 non-alphanumeric symbol (e.g. @ ‘$%£!’)

Using the code

When you are using jQuery.ajax then on the server side the there must be a WebMethod. Using jQuery I captured the Click event of the Register button and
call the WebMethod using jQuery.ajax by passing the Password field value as perameter:

I really don't see the point of validating it on the server. JavaScript (even without jQuery) is enough to validate the four rules you propose as strong password (perhaps you missed the actual length of the password?).

In a production environment, you would be flooding the server with requests for such a simple task that could be executed on server side.