America/US Samples
Europe Samples
Asia Samples

Gaia Ajax: How to create a simple Captcha

A Captcha  is a type of challenge-response test used in computing to ensure that the response is not generated by a computer. This example shows how easy it is to build a simple Captcha control using Gaia Ajax. The features are not complete, and we have left it to you make it complete. The core of the sample is the Gaia Ajax DynamicImage control, which you will find in the user control.

First Name:  
Last Name:  
   
Retype the text
on the image:


Markup (ASPX/.aspx)

   1:   
   2:      <table>
   3:          <tr>
   4:              <td>
   5:                  First Name:
   6:              </td>
   7:              <td>
   8:                  <gaia:TextBox ID="zFirstName" runat="server" />
   9:                  <gaia:RequiredFieldValidator 
  10:                      ID="zRequiredFieldValidator1" 
  11:                      runat="server"
  12:                      ControlToValidate="zFirstName">*</gaia:RequiredFieldValidator>
  13:              </td>
  14:          </tr>
  15:          <tr>
  16:              <td>
  17:                  Last Name:
  18:              </td>
  19:              <td>
  20:                  <gaia:TextBox ID="zLastName" runat="server" />
  21:                  <gaia:RequiredFieldValidator 
  22:                      ID="zRequiredFieldValidator2" 
  23:                      runat="server"
  24:                      ControlToValidate="zLastName">*</gaia:RequiredFieldValidator>
  25:              </td>
  26:          </tr>
  27:          <tr>
  28:              <td>
  29:                  &nbsp;</td>
  30:              <td>
  31:                  &nbsp;</td>
  32:          </tr>
  33:          <tr>
  34:              <td valign="bottom">
  35:                  Retype the text<br />
  36:                  on the image:</td>
  37:              <td>
  38:                  <uc1:Captcha 
  39:                      ID="zCaptcha" 
  40:                      runat="server" 
  41:                      CaptchaLength="5" />
  42:              </td>
  43:          </tr>
  44:          <tr>
  45:              <td>
  46:              </td>
  47:              <td>
  48:                  <gaia:Button ID="zSubmit" runat="server" OnClick="zSubmit_Click"
  49:                      Text="Submit Form" /></td>
  50:          </tr>
  51:          <tr>
  52:              <td>
  53:              </td>
  54:              <td>
  55:                  <gaia:Label ID="zResult" runat="server"></gaia:Label></td>
  56:          </tr>
  57:      </table>
  58: