Welcome to another AJAX tutorial, today we will be demonstrating how to use the NoBot extender.

NoBot is an essential tool to safeguard you from spam and spam comments on your popular blog. This is an awesome tool and so easy to use and integrate to your current page. We will show you how really easy it is to use.

NoBot is a control that attempts to provide CAPTCHA-like bot/spam prevention without requiring any user interaction. This approach is easier to bypass than an implementation that requires actual human intervention, but NoBot has the benefit of being completely invisible. NoBot is probably most relevant for low-traffic sites where blog/comment spam is a problem and 100% effectiveness is not required.

Following are the different types of AJAX NoBot control responses:

Valid: When NoBot control verifies the actions performed by a user and it passes all the tests then the user is considered as human.

InvalidBadResponse: When challenge script fails the test then AJAX NoBot control returns the bad response.

InvalidResponseTooSoon: When postback occurs more quickly than a specified ResponseMinimumDelaySeconds.

InvalidAddressTooActive: When a single client’s IP remains active for a long time and performs number of postback then it returns the InvalidAddressTooActive.

InvalidBadSession: When ASP.Net session state becomes unusable.

InvalidUnknown: When unknown problem occurs

Lets begin building our No Bot server side spam check.

This is going to be quite simple as we are only going to validate the users IP address
So our first step is to Open Visual Studio 2010 and we can make a new webform.
Now go to your design view and drag and drop a Tool Script Manager.

Now we can begin building our Labels to display our Spam check along with our Users IP address.

So drag in a label into our workspace and Give it a Text of noBot reposne State:

Now move onto our second Label this will also display our NoBot response address as well, but only if it’s valid.

Our third Lable will display our Users IP address:

Our Fourth label will display our maxmim response state of the IP address.

Now we are ready to add our NoBot Extender to our page. Go ahead and drag that into our form right underneath our 4th label. For this we set the properties for a CutOffMaximumInstance set to 5 and CutOffWindowSeconds is set to 60, and set a ResponseMinimumDelaySeconds to 2. You can reference these properties right above before we started this tutorial for a detailed explanation of each property set. Below is the markup for the No bot Extender.

Now we need to add an ASP button to activate this process.

Here is the full mark up for the front end:

Let’s build our logic into our labels and use the full capabilities of the NoBot Extender.

Here is the code for the NoBot Spam Check.

These look very self-explanatory but let’s go into some details of what is actually happening once the button is clicked.

So our Method NoBot State is being checked if the response to the server is valid, then we put and if/else statement to determine if the string matches a bot or a human IP address. If the IP address is used to submit a form to many times the NoBot Extender will then revert to blocking the IP address and will display an Invalid Response to Soon message.

Now load your page and see it in action should look something like this.

Download Source Files