ProfK
ProfK

Reputation: 51084

Problem with using the MvcReCaptcha library in a view

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 human.</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?

Upvotes: 1

Views: 1078

Answers (1)

Darin Dimitrov
Darin Dimitrov

Reputation: 1039318

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.

Upvotes: 0

Related Questions