我有reCaptcha安装问题。我已经看过一些关于它的帖子,即使在StackOverflow中,但它并没有帮助我让它工作。
我关注了this post和this post,但是在这一行:
@using Microsoft.Web.Helpers
我收到消息:
名称空间“Microsoft.Web”中不存在类型或命名空间名称“Helpers”(您是否缺少程序集引用?)
我添加了所有提到的引用,web.config文件(root和view文件夹)中的所有程序集,重新启动VS2010,更新了MVC3程序包,包含了WebMatrix程序包,但我无法使其正常工作。
我想安装应该很简单,但我不知道我做错了什么。
有人可以帮助我吗?
答案 0 :(得分:2)
这是一步一步指南:
microsoft-web-helpers
NuGet 在Index.cshtml
的{{1}}视图中创建表单并将HomeController
命名空间纳入范围:
Microsoft.Web.Helpers
并验证控制器中的验证码:
@using Microsoft.Web.Helpers
@using (Html.BeginForm())
{
@ReCaptcha.GetHtml(publicKey: "__ put your public key here __")
<button type="submit">OK</button>
}