I have mvc web app i need to use captcha ,
i did it like add an dll which i have got from codeplex but
at register.aspx page I have added that code like following which is giving me capcha
<%: CaptchaMVC.HtmlHelpers.CaptchaHelper.Captcha(Html,"Refresh","Input Symbols",5) %>
and code at AccountController.cs:
[HttpPost]
public ActionResult NotAttribute()
{
if (this.IsCaptchaVerify("Captcha is not valid"))
{
TempData["Message"] = "Captcha is valid";
return View();
}
TempData["Message"] = "Captcha is not valid";
return View();
}
[HttpPost]
[CaptchaVerify("Captcha is not valid")]
public ActionResult UseAttribute()
{
if (ModelState.IsValid)
{
TempData["Message"] = "Captcha is valid";
return View();
}
TempData["Message"] = "Captcha is not valid";
return View();
}
But in its not working properly as in debug mode too after clicking on register button it is not able to hit any one these method
why?
If it’s not too late may I suggest an alternative to CAPTCHA, here is why:
http://www.codinghorror.com/blog/2008/03/captcha-is-dead-long-live-captcha.html
if you are sold, here is a simple technique I use called the Honeypot,
you can add this to your View
now you have a hidden field on your form, then in your controller,
basically only a robot attacking your registration process would be filling this field.
did I mention that this makes for a better user experience too?
Here is the blog post that inspired the solution:
http://haacked.com/archive/2007/09/11/honeypot-captcha.aspx