且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在服务器端验证验证码

更新时间:2022-10-16 23:08:46

 如果要是CAPTCHA文本是正确的(Page.IsValid)//将是真实的,否则这将是错误的
{
 // ***您code ****}

编辑:
呼叫
Page.Validate()检查条件之前

I am using Google recaptcha in one of our projects. I added the recaptcha control in aspx page. Now i want to validate the value entered in recaptcha that is whether it is correct or not. How can i done it in a button click event? I am using c#.

if(Page.IsValid) //Will be true if captcha text is correct otherwise it will be false
{
 //***your code****

}

Edit: call Page.Validate() before checking condition