开发者

Problem with using the MvcReCaptcha library in a view

开发者 https://www.devze.com 2023-02-25 04:54 出处:网络
The MvcReCaptcha library looks very solid, and appears to have some good developer adoption, but when I tried it for the first time today, using the supplied HTML helper, my app won\'t run.I have the

The MvcReCaptcha library looks very solid, and appears to have some good developer adoption, but when I tried it for the first time today, using the supplied HTML helper, my app won't run. I have the helper in a partial view as follows:

<fieldset>
    <legend>3. Verify that you are a hu开发者_开发百科man.</legend>
        @Html.GenerateCaptcha()
</fieldset>

I have the namespace included in web.config as instructed:

<pages>
    <namespaces>
        <add namespace="System.Web.Helpers" />
        <add namespace="MvcReCaptcha.Helpers"/>
    </namespaces>
</pages>

(Other namespaces removed for brevity)

And I have my private and public keys defined in appSettings. I can see no way that I deviate from the examples on the CodePlex page except that I am using Razor. Can anyone offer some insight into what I may be doing wrong?


If you are using Razor you need to add the MvcReCaptcha.Helpers namespace to the <namespaces> section of ~/Views/web.config file and not the one in ~/web.config.

0

精彩评论

暂无评论...
验证码 换一张
取 消