Hi guys,
I am using rad captcha in my site and want to prevent the user if
user type the wrong captcha test . So for this i am validate the captcha by coding.
But i am facing the problem that captcha always give Return false in if(radcaptcha1.isvalid) and print error.
Here my code of Default.aspx
And the code of default.aspx.cs is
Plz help me out for this problem there is any general solution of this.
I am structed with this problem plz telrik help me ya give me some example by this i can accomplish it.
I am using rad captcha in my site and want to prevent the user if
user type the wrong captcha test . So for this i am validate the captcha by coding.
But i am facing the problem that captcha always give Return false in if(radcaptcha1.isvalid) and print error.
Here my code of Default.aspx
<
asp:Label
ID
=
"lblCaptcha"
runat
=
"server"
ForeColor
=
"Red"
></
asp:Label
>
<
telerik:RadCaptcha
ID
=
"RadCaptcha1"
runat
=
"server"
validationgroup
=
"Submit"
>
</
telerik:RadCaptcha
>
<
asp:UpdatePanel
runat
=
"server"
ID
=
"UPbtnUpload"
>
<
ContentTemplate
>
<
asp:ImageButton
runat
=
"server"
ID
=
"btnUpload"
CssClass
=
"btnAdd"
ImageUrl
=
"~/Images/btnUpload.jpg"
OnClick
=
"btnUpload_OnClick"
ValidationGroup
=
"Submit"
/>
</
ContentTemplate
>
<
Triggers
>
<
asp:PostBackTrigger
ControlID
=
"btnUpload"
/>
</
Triggers
>
</
asp:UpdatePanel
>
protected void btnUpload_OnClick(object sender, EventArgs e)
{
RadCaptcha1.Validate();
Page.Validate();
if (RadCaptcha1.IsValid)
{
testimonial.ClubName = txtClub.Text;
testimonial.Desciption = txtDiscription.Text;
if (imageFileUpload.UploadedFiles.Count > 0)
{
Guid guid = new Guid();
testimonial.FileName = imageFileUpload.UploadedFiles[0].FileName;
testimonial.FilePhysicalPath = imageFileUpload.TargetFolder;
testimonial.FileUrl = imageFileUpload.TargetFolder + imageFileUpload.UploadedFiles[0].FileName;
}
bool isCreated = KiwanisDataServices.CreateTestimonial(testimonial, ddlState.SelectedValue.ToString());
ResetForm();
}
else
{
lblCaptcha.Enabled = true;
lblCaptcha.Text = "The code you entered is not valid";
return;
//RadCaptcha1.ErrorMessage = "deepak";
}
I am structed with this problem plz telrik help me ya give me some example by this i can accomplish it.