---
title: "Ajax Toolkit NoBot Control in ASP.Net"  
description: "AJAX NoBot extender control checks all the behaviors and detects whether the action is being performed by the human or automated software. AJAX NoBot"  
author: "Pushpendra Singh"  
published: 2010-12-07  
updated: 2020-09-22  
canonical: https://www.mindstick.com/articles/273/ajax-toolkit-nobot-control-in-asp-dot-net  
category: "ajax"  
tags: ["ajax"]  
reading_time: 3 minutes  

---

# Ajax Toolkit NoBot Control in ASP.Net

AJAX **NoBot extender control** checks all the behaviors and detects whether the action is being performed by the human or automated software. AJAX **NoBot** control caches the IP address of the client. A great feature of the NoBot control is its *invisibility*.\

## NoBot Properties:

· **ResponseMinimumDelaySeconds** - minimum number of seconds before which a response (postback) is considered invalid.

· **CutoffWindowSeconds** - Optional number of seconds specifying the length of the cutoff window that tracks previous postbacks from each IP address.

· **CutoffMaximumInstances** - Optional maximum number of postbacks to allow by a single IP addresses within the cutoff window.

· **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.

## Code:

Write these codes on aspx page

```
 <%-- ScriptManager control manages client script for AJAX enabled ASP.NET pages.This enables partial-page rendering and Web-service calls.You have to used this if you want to use ajax control toolkit--%><asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> <%-- Add NoBot Control--%>  <cc1:NoBot ID="NoBot1" runat="server" Enabled="true"  CutoffMaximumInstances="1" CutoffWindowSeconds="2"  ResponseMinimumDelaySeconds="5" /> <%-- Add Panel and some control--%>  <asp:Panel ID="Panel1" runat="server"> <asp:Label ID="Label1" runat="server" Text=" User Id"></asp:Label> <asp:TextBox ID="TextBox1" runat="server" Text="Id"></asp:TextBox> <br /> <asp:Label ID="Label2" runat="server" Text="Password"></asp:Label> <asp:TextBox ID="TextBox2" runat="server" Text="12"></asp:TextBox> <br /> <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" /> <asp:Label ID="Label3" runat="server" Text=""></asp:Label> <asp:Label ID="Label4" runat="server" Text=""></asp:Label></asp:Panel>
```

Here ResponseMinimumDelaySeconds="5" indicate that user should submit form after 5 second and if user click before 5 second then error message will show.

Write these code on Button1 click

```
protected void Button1_Click(object sender, EventArgs e){       NoBotState state;               if (NoBot1.IsValid(out state)) //Check the condition is valid or not            Label3.Text = state.ToString();             else            Label3.Text = "Page not valid";          StringBuilder sb = new  StringBuilder();//Make the object of StringBuilderforeach (KeyValuePair<DateTime, string> keyValue in NoBot.GetCopyOfUserAddressCache())      {            sb.Append(keyValue.Value);      }      Label4.Text = sb.ToString();}
```

**Run the project**

![AjaxControl Toolkit NoBot Control in ASP.Net](https://www.mindstick.com/mindstickarticle/019e816a-4331-4cd2-bdb0-7da690b0cfea/images/f452ddf3-3790-41ee-abf7-d3759314f0a5.png)

In this example ResponseMinimumDelaySeconds="5" so if you clickSubmit button before 5 second then error message will show and it will also show the IP address.

![AjaxControl Toolkit NoBot Control in ASP.Net](https://www.mindstick.com/mindstickarticle/019e816a-4331-4cd2-bdb0-7da690b0cfea/images/e8e7bab9-7b40-4026-b1c0-a07970d20ad8.png)

If you click submit button after 5 second then error message will not show.

![AjaxControl Toolkit NoBot Control in ASP.Net](https://www.mindstick.com/mindstickarticle/019e816a-4331-4cd2-bdb0-7da690b0cfea/images/f70a80de-4222-4b0b-89ab-819f898059af.png)

---

Original Source: https://www.mindstick.com/articles/273/ajax-toolkit-nobot-control-in-asp-dot-net

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
