Sitefinity 使用内置验证码

发布于 2024-07-18 11:52:47 字数 111 浏览 6 评论 0 原文

有谁知道如何将自定义控件(简单的 ASP.net 表单)与 sitefinity 的 Captcha 控件绑定?

似乎无法在 SiteFinity.Web.UI 中找到控件(在拖放意义上)

Does anyone know how to tie a custom control (simple ASP.net Form) with sitefinity's Captcha control?

Can't seem to find the control (in the drag and drop sense) in amongst the SiteFinity.Web.UI

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

梦毁影碎の 2024-07-25 11:52:47

我一直在寻找完全相同的东西,经过多次搜索后我找到了这个解决方案。

在表单/用户控件的源视图中添加此引用:

<%@ Register Assembly="Telerik.Cms.Web.UI" Namespace="Telerik.Web.UI.SpamProtection" TagPrefix="sfWeb" %>

然后您可以使用类似以下内容:

<sfWeb:SpamProtector
    ID="SpamProtector1" 
    runat="server" 
    ValidationGroup="ctl00$PasswordRecovery1" 
    CaptchaImageWidth="180" 
    CaptchaImageHeight="50" 
    CapcthaInvalidInputMsg="The code you entered doesn't match the code in the image. Please try again." 
    EnableCaptcha="true" 
    CaptchaTextBoxLabel="Please type in the code shown in the image above." 
    CaptchaBackgroundNoise="Medium" 
    CaptchaLineNoise="Low"
    CaptchaFontWarp="Medium"
    CaptchaLength="5" 
    CaptchaPossibleChars="Numbers" 
    CaptchaMaxTimeout="5" 
    ErrorMessageCssClass="validation-error"></sfWeb:SpamProtector>

此解决方案位于本文 http://blogs.sitefinity.com/Ivan/Posts/08-10-29/How_to_associate_Image_Gallery_with_content_item_e_g_news_item__-_finish ing_touches.aspx

唯一的问题是生成的验证码图像的位置指的是用户控件的位置,即 localhost/MyWebsite/UserControls/Login/CaptchaImage.axd?guid=a2b92290-1bad-450a-a58b-7c813a228d62

I've bee looking for exactly the same thing and after much searching I found this solution.

In the source view of your form/usercontrol add this reference:

<%@ Register Assembly="Telerik.Cms.Web.UI" Namespace="Telerik.Web.UI.SpamProtection" TagPrefix="sfWeb" %>

Then you can use something like this:

<sfWeb:SpamProtector
    ID="SpamProtector1" 
    runat="server" 
    ValidationGroup="ctl00$PasswordRecovery1" 
    CaptchaImageWidth="180" 
    CaptchaImageHeight="50" 
    CapcthaInvalidInputMsg="The code you entered doesn't match the code in the image. Please try again." 
    EnableCaptcha="true" 
    CaptchaTextBoxLabel="Please type in the code shown in the image above." 
    CaptchaBackgroundNoise="Medium" 
    CaptchaLineNoise="Low"
    CaptchaFontWarp="Medium"
    CaptchaLength="5" 
    CaptchaPossibleChars="Numbers" 
    CaptchaMaxTimeout="5" 
    ErrorMessageCssClass="validation-error"></sfWeb:SpamProtector>

This solution was found buiried inside this article http://blogs.sitefinity.com/Ivan/Posts/08-10-29/How_to_associate_Image_Gallery_with_content_item_e_g_news_item_-_finishing_touches.aspx

The only issue is that the location of the generated captcha image refers to the location of your usercontrol i.e. localhost/MyWebsite/UserControls/Login/CaptchaImage.axd?guid=a2b92290-1bad-450a-a58b-7c813a228d62

素年丶 2024-07-25 11:52:47

快速谷歌搜索结果如下:
http://www.sitefinity.com/ help/developer-manual/built-in-spam-protector-strategies.html

确保您已添加正确的引用。 根据 API 参考 看来您可能需要添加对 Telerik.Web.UI 库的引用。

A quick Google search results in:
http://www.sitefinity.com/help/developer-manual/built-in-spam-protector-strategies.html

Make sure you have added the correct references. According to the API Reference it seems you might need to add a reference to the Telerik.Web.UI library.

筑梦 2024-07-25 11:52:47

为什么不能直接通过 Sitefinity 页面编辑器将 Captcha 控件拖放到页面上? 这就是我要做的

How come you can't just drop the Captcha control onto the page through the Sitefinity page editor? That is what I would do

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文