|
<%@ Page language="c#" AutoEventWireup="false" %>
<%@ Register Namespace="Captcha" Assembly="CaptchaControl" TagPrefix="cc" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<script language="c#" runat="server">
void btnSubmit_Click(object sender, System.EventArgs e)
{
if (captcha.Validate(this.tbInput.Text))
{
//at this point we should redirect to a different page
this.lblMsg.Text = "Code validated, image Deleted";
}
else
{
this.lblMsg.Text = "Validation failed, invalid code.";
}
}
void btnReset_Click(object sender, System.EventArgs e)
{
this.Response.Redirect("default.aspx");
}
</script>
<html>
<body>
<b>Captcha Control Test</b>
<form runat="server">
<cc:CaptchaControl ID="captcha" runat="server" CharCount="5" Width="200" CharSet="NumberAndLetters"/>
<p>
<b>Enter the code shown above:</b><br/>
<asp:TextBox id="tbInput" runat="server"></asp:TextBox>
<asp:Button id="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_Click"></asp:Button>
<asp:Button id="btnReset" runat="server" Text="Reset" OnClick="btnReset_Click"></asp:Button><br/>
</p>
<asp:Label id="lblMsg" runat="server"></asp:Label>
</form>
</body>
</html>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.