<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TestCaptcha.aspx.cs" Inherits="TestCaptcha" %> <%@ Register Assembly="ncToolControls" Namespace="ncToolControls" TagPrefix="nc" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Test Captcha Field</title> </head> <body> <form id="form1" runat="server"> <div> <table style="border: 1px solid black; background-color: InfoBackground; width: 15%;" id="table1"> <tr> <td colspan="2" align="center"> <nc:CaptchaField ID="captc" Width="80" Height="30px" Font_Size=14 Font_Family="Verdana" runat="server" /> </td> </tr> <tr> <td align="right">Code:</td> <td align="left"><asp:TextBox ID="txtCatpcha" runat="server"></asp:TextBox></td> </tr> <tr><td colspan="2"> </td></tr> <tr> <td colspan="2" align="center"><asp:Button ID="btnSubmit" Text="Submit" OnClick="btnSubmit_Click" runat="server" /></td> </tr> <tr><td colspan="2"> </td></tr> </table> <p align="center"><asp:Label ID="lblMessage" BackColor="Red" runat="server"></asp:Label></p> </div> </form> </body> </html>
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class TestCaptcha : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { } } protected void btnSubmit_Click(object sender, EventArgs e) { if (this.txtCatpcha.Text.Trim() == Session["random_captcha_field"].ToString()) { this.lblMessage.Text = "Successfully Passed"; } this.txtCatpcha.Text = ""; } }
Trouble logging in? Simply enter your email address OR username in order to reset your password.
For faster and more reliable delivery, add support@netstaircom.net to your trusted senders list in your email software.