How exactly do you get ReCaptcha work in MVC3 with razor? I tried "Install-Package microsoft-web-helpers" but still could not get it to work on my .cshtml razor page, it cannot find the type ReCaptcha. And, on http://nuget.org/List/Packages/microsoft-web-helpers someone left comment saying "This package currently works with WebMatrix only". While this article shows it may work http://www.dotnetcurry.com/ShowArticle.aspx?ID=611
相关问题
- Entity Framework throws exception - Network Relate
- Slow loading first page - ASP.NET MVC
- TextBoxFor decimal
- How to do an inline style with asp.net mvc 3 razor
- How to access the System.ComponentModel.DataAnnota
相关文章
- “Dynamic operations can only be performed in homog
- Change color of bars depending on value in Highcha
- How to get server path of physical path ?
- Breakpoint in ASP.NET MVC Razor view will not be h
- How to define function that returns html in asp.ne
- How to find the exceptions / errors when TryUpdate
- ASP.Net MVC 3: optgroup support in Html.DropDownLi
- A circular reference was detected while serializin
See this http://eglasius.blogspot.com/2010/10/adding-recaptcha-to-aspnet-mvc.html
You might need to make the
Microsoft.Web.Helpers
namespace available to the views. In your Web.config (the one in yourViews
folder) add:Then you can use the following helper in your view:
If the namespaces setting doesn't work, you could try to add
@using Microsoft.Web.Helpers
statement on top of the view to see if that helps. If it does, you'll have to try and find out why the namespace setting in the web.config isn't working...Might be too late to the party but I could not get any of the examples out there to work with MVC3. Microsoft's helpers does not appear to work either.
Finally downloaded the reCaptcha binary from google code for .net - http://code.google.com/p/recaptcha/downloads/list and created a custom razor Html helper.
Code is available on Github - https://github.com/clearinterface/MvcRecaptcha
Hope this helps.
The answers above are not 100% complete so I wrote a tutorial that covers every single step.