我在 dnn 7.1 上工作。我在 DNN 页面中添加了 Google catcha。请参阅本网站的参考资料
在这个参考的帮助下,我在 dnn 页面中添加了验证码。但在验证码验证中不起作用。任何东西都写在文本框中。不显示错误信息。并成功提交表单。任何人都可以帮助我进行验证。代码如下
<%--<%@ Register TagPrefix="recaptcha" Namespace="Recaptcha" Assembly="Recaptcha" %>--%>
<%@ Control Language="C#" ClassName="Admin.ContactUs" Inherits="DotNetNuke.Entities.Modules.PortalModuleBase" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Collections" %>
<%@ Import Namespace="System.Configuration" %>
<%@ Import Namespace="System.Data" %>
<script runat="server">
protected void btnSubmit_Click(object sender, EventArgs e)
{
if (Page.IsValid)
{
SendMailTest();
}
else
{
}
}
protected void Page_Load(object sender, EventArgs e)
{
}
</script>
<div class="contactusform-left commonclass lF">
<asp:Label ID="lblmsg" runat="server" Text=""></asp:Label>
/* Code for textbox, dropdowm */
</div>
<div class="contactusform-right commonclass lF">
<div class="contactusform-set-textarea contactusform-set" style="height:150px;">
<label class="lF">
Captcha <span>*</span></label>
<div style="clear:left;width:100%;height:100px;">
<recaptcha:RecaptchaControl ID="recaptcha" runat="server" PublicKey="6LdCxeYSAAAAAAP-uIGWnsZHeW7rn8rzeeblc5g"
PrivateKey="6LdCxeYSAAAAAFvnxCiaN_7vkHp-vaVRRYb9yVF" />
<asp:Label Visible=false ID="lblResult" runat="server" />
</div>
</div>
<div style="clear:both;"></div>
<div class="contactusform-set " style="margin-top:10px;">
<asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_Click"
ValidationGroup="ContactUsValidate" />
<asp:Button ID="btnCancel" runat="server" Text="Cancel" Style="color: #8D8D8D; cursor: pointer;
float: right; font-weight: bold; height: 34px; margin-right: 5px; text-transform: uppercase;
width: 120px;" />
</div>
</div>