In Asp.Net forums and in many other user communities I have seen lot of people asking for VB.Net CAPTCHA. So I thought to write a blog post and create some sample implementations. The zip file contains C# CAPTCHA and VB.Net CAPTCHA. I have included the samples for Asp.Net AJAX CAPTCHA also.
You can download the samples and implementation from here
Implementing Asp.Net AJAX CAPTCHA is really simple. Just wrap the main Asp.Net CAPTCHA with Asp.Net AJAX update panel and put a random query string at the end of CAPTCHA image src. The random query string will avoid showing the old CAPTCHA from browser cache.
STEPS TO ADD ASP.NET CAPTCHA IN YOUR WEBSITE
- Refer the assembly CaptchaDLL.dll in your project
- Copy JpegImage_CS.aspx or JpegImage_VB.aspx (according to the language of choice) to your website.
- Open the above file and make changes in Colors and Font if needed. (read the inline comments to know more)
- Now user the sample codes from Default.aspx or Ajax.aspx pages. The code is straight forward. You make a session and generate an image with the string in the Session. Now when you submit you have to check the session value and textbox value to see whether the entered CAPTCHA is correct.
If you have any questions please put as a comment.
Tags
Asp.Net CAPTCHA, CAPTCHA, VB.Net CAPTCHA, C# CAPTCHA, ASP CAPTCHA, C sharp captcha, vb captcha, simple captcha, AJAX CAPTCHA, asp.net ajax captcha, captcha without refresh, captcha using ajax, numeric captcha
Comments
Thanks
Saqib Vaid
Is it free to use this CAPTCHA tool in my web site? Or I required some agreement, licensee? Thank you
Its free and there is no licenses needed to use in your projects..
Thanks
Raj.
Nice and easy.
What is meant by "Refer the assembly CaptchaDLL.dll in your project" and how do you it?
Scott
I think the folder contaning JpegImage_CS.aspx (JpegImage_VB.aspx ) does not have anonymous permission.. Try accessing the page directly (like http://localhost/yoursite/JpegImage_CS.aspx ) and see whether its redirecting to login page...
If so you need to give anonymouse permission to that file...
See thios link to know how you can exclude a page from security settings...
http://support.microsoft.com/kb/316871
You need to add reference of that assembly in your project..
In the Visual studio right click on the solution explorer and select Add reference.. now go to Browse tab and browse the CaptchaDLL.dll from the downloaded source.. click OK'..
See the following links for more details
http://msdn.microsoft.com/en-us/library/wkze6zky(VS.80).aspx
http://www.csharp411.com/adding-assemblies-to-the-visual-studio-add-reference-dialog/
Regards
Anz
Now the problem is that the Captcha image is not appearing. I have this in a login control. Funny thing is that if I replace the src="JpegImage_VB.aspx" with a graphic from my Images folder, the image doesn't display either.
The JpegImage_VB.aspx file is in the sites root directory. When I start with debugging and have a breakpoint in the JpegImage_VB.aspx file it doesn't appear the file is being executed.
When the login comes up, the alt text "Visual Verification" appears.
Any ideas?
Looks Good.
Can't thank you enough for your help.
Thanks a lot! That worked!
Raj.
you got it working???
if no please refer to my reply to Raj.. that may be the reason the image not displaying
http://anzme.blogspot.com/2008/10/i-am-using-great-asp.html?showComment=1241716980000#c3538917920615613706
I've tryed for hour to put captcha in my web page but I can't do that the image don't appear I see the error "Visual Verification".
I'm not sure to have do right thing.
Can u tell step by step what I have to do?
What I must put in the folder and where? thx a lot
-BiFe-
Thanks for your help!
Thanks a lot
Anthony