<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

  protected void ProcessData(object sender, EventArgs e)
  {
    NoBotState state;
    if (!NoBot1.IsValid(out state))
    {
      Label1.Text = "Wpis odrzucony (" + HttpUtility.HtmlEncode(state.ToString()) + ")!";
    }
    else
    {
      Label1.Text = "Wpis zaakceptowany!";
    }
  }
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
  <title>ASP.NET AJAX</title>
</head>
<body>
  <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
    <div>
      Komentarz do informacji z blogu: 
      <asp:TextBox ID="TextBox1" TextMode="MultiLine" runat="server" />
      <br />
      <asp:Button ID="Button1" runat="server" 
        Text="Wprowadź komentarz" OnClick="ProcessData" />
      <br />
      <asp:Label ID="Label1" runat="server" />
    </div>
    <ajaxToolkit:NoBot ID="NoBot1" runat="server" 
      CutoffMaximumInstances="5" CutoffWindowSeconds="30" ResponseMinimumDelaySeconds="3" />
  </form>
</body>
</html>
