How to use Captcha Code in your mvc project

1) how to check captcha in controller.(write this code to your controller function)

using Capcha.HtmlHelpers;

// Code for validating the CAPTCHA  

if (this.CheckCapcha()){ 

    *// do case of capcha is valid*

}

2) how to display captcha in view(write this code to your view)

using Capcha.HtmlHelpers;

  @using Capcha.HtmlHelpers; //import this library on top

  @Html.Captcha(4) // if you want to display capcha with 4 char. replace 4 to your appropriate number to display n length capcha.

  @Html.MathCaptcha()  // if you want to display capcha as maths formula like (7+1=?),(2+95=?),etc.



Note :-Click Here to Download Captcha dll.



Post a Comment

0 Comments