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?
- do use nuget? if don't, right click on reference section of project , choose ad library package reference
- get online tab, , install microsoft web helpers dll
- 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
Post a Comment