This demo is a bit more visual than the previous. It
demonstrates the visible captcha.
Click submit and you should see a success message if
you entered the CAPTCHA correctly.
To get the visible CAPTCHA to work, you need to add an entry to the httpHandlers section of code.
<?xml version="1.0"?>
<configuration>
<system.web>
<httpHandlers>
<add verb="*"
path="*CaptchaImage.ashx"
type="Subkismet.Captcha.CaptchaImageHandler, Subkismet" />
</httpHandlers>
</system.web>
<configuration>
Then you can use it as the following demonstrates.
<script runat="server" language="C#">
protected void OnVisibleCaptchaButtonClick(object sender, EventArgs args)
{
if(Page.IsValid)
{
visibleSuccessLiteral.Visible = true;
}
}
</script>
<p class="success">
<asp:Literal ID="visibleSuccessLiteral"
runat="server"
Text="Valid!"
EnableViewState="false"
Visible="false" />
</p>
<div class="captcha">
<sbk:CaptchaControl id="captcha"
runat="server"
ErrorMessage="Oops! You must be bad at reading."
Display="dynamic"
CaptchaLength="4"
ValidationGroup="Visible" />
</div>
<div>
<asp:Button ID="visibleButton" runat="server"
Text="Submit"
OnClick="OnVisibleCaptchaButtonClick"
ValidationGroup="Visible" />
</div>