Can you recommend a CAPTCHA library for use with an ASP.NET MVC application? -


if you've incorporated captcha asp.net mvc application, did use external captcha library of kind? if so, recommend , why?

  1. do use nuget? if don't, right click on reference section of project , choose ad library package reference
  2. get online tab, , install microsoft web helpers dll
  3. in refrence, find handy helper recaptcha.gethtml

you can use on view below;

@recaptcha.gethtml(configurationmanager.appsettings["recaptcha-public-key"], "white") 

i keep recaptcah keys inside web.config used configurationmanager.appsettings reach them. can own public , private keys http://www.google.com/recaptcha

in controller, easy handle legitimate call below;

if (recaptcha.validate(configurationmanager.appsettings["recaptcha-private-key"])) {   //the call legitimate  } else {  // call not legitimate  } 

i hope helps.

update 1 uppps. don't forget put private , public keys inside _viewstart.cshtml file below;

@{     layout = "~/views/shared/_layout.cshtml";     recaptcha.privatekey = configurationmanager.appsettings["recaptcha-private-key"];     recaptcha.publickey = configurationmanager.appsettings["recaptcha-public-key"]; } 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -