|
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!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></title>
<!-- recaptcha client library -->
<script type="text/javascript" src="http://api.recaptcha.net/js/recaptcha_ajax.js"></script>
</head>
<body>
<form id="form1" runat="server">
<div>
<%
// don't show another captcha after success
if (!Page.IsPostBack || (Page.IsPostBack && !Page.IsValid)) {
// client-side captcha creation (note the server-side injection of the public key and the page culture)
%>
<div id="recaptcha_div"></div>
<script type='text/javascript'>
Recaptcha.create("<%=Config.PublicKey %>",
"recaptcha_div", {
lang: "<%=LanguageCode %>",
theme: "clean",
callback: Recaptcha.focus_response_field
});
</script>
<asp:Button runat="server" ID="submitBtn" Text="Submit" OnClick="OnSubmit" />
<% } %>
<asp:CustomValidator runat="server" ID="recaptchaValidator" OnServerValidate="OnRecaptchaValidate" Text="Incorrect" />
<asp:Label runat="server" ID="Outcome" />
</div>
</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.
I've been a web application developer since the late 1990s, working for eCommerce, media and telecoms companies across europe and america.