SharePoint 2007 (MOSS/WSS) – Custom CAPTCHA (Antispam) Field


I saw a nice post in CodeProject (http://www.codeproject.com/KB/aspnet/CaptchaImage.aspx) regarding CAPTCHA image control. I used the same code to create a Custom Field that will work like a CAPTCHA field for SharePoint. I tested it with Custom List and Blog Post suceessfully. You need to enable the session in the Web.Config file using enableSessionState=”true” as it depends heavily on session. Here is how it looks like:

captcha 

Here is the screenshot of the Solution Explorer:

soexplr

You can download the WSP file and the project in a zip file from here.

CaptchaField.zip

Comments (16)

  1. PANoone says:

    @pranab : Have you managed to get the supplied code working? I'm wondering if there's a missing dependency at my end.

    I have enabled SessionState for the destination web app through Central Administration and confirmed the setting in the web.config under httpmodules section.

    Is this correct, or are you referring to the <pages> enableSessionState setting?

    Any advice appreciated as I would dearly love to see this in action.

  2. Panoone says:

    @Rob Ashcroft: There is no feature included within the WSP. The feature ID specified relates to the RoleManagement feature within MOSS and is likely unrelated.

    @pranab: I have deployed the solution and am receiving a blank image. Looking at the source I notice that GenerateImage.aspx contains no data to render the CAPTCHA image. Are you able to provide the required rendering for this??

  3. Rob Ashcroft says:

    After deploying this solution, all I get is this error…

    Failed to determine definition for Feature with ID ‘f3808a5f-354c-4216-bf9e-dcfa8c44f0fc’.  Skipping this feature for element querying consideration.  

    Failed to determine definition for Feature with ID ‘f3808a5f-354c-4216-bf9e-dcfa8c44f0fc’.  Skipping this feature for element querying consideration.  

    Exception Type: System.NullReferenceException  Exception Message: Object reference not set to an instance of an object.

    any ideas anyone

  4. Miguel says:

    The image is not showed in the form, I set the enableSessionState="true", but the form only shows an "X", could you pls help me?

  5. Como cada mes, desde hace ya un par de a&ntilde;os, aqu&iacute; os dejo el cl&aacute;sico recopilatorio

  6. SharePoint Create your own customized usage report solution step by step SharePoint WebPart Property

  7. Pranab-MSFT says:

    Anthony,

    This is just an sample and never tested for production. You need to modify and test it suitably if you want to use it in production.

  8. Anthony says:

    Are there any security implications in implementing this?  Does this solution open any other vulnerabilities(i.e. through the GAC)?

  9. brad says:

    I Supposed your solution assemble Sharepoint Form Validation http://www.sharepointboost.com/formvalidation.html, but their focus is different.

    Good blog, though.

  10. jackinthegreen says:

    thanks for the nice solution. Question, is this something that could be used for a custom login application page in WSS 3.0 as well? thanks!

  11. Direkter Download: SPPD-108-2009-01-08 Veranstaltungen SharePoint UserGroups Termine im Januar 2009 ppedv

  12. Direkter Download: SPPD-108-2009-01-08 Veranstaltungen SharePoint UserGroups Termine im Januar 2009 ppedv

  13. Dezember HotFix Update The December cumulative update for WSS V3 and MOSS 2007 WSS Download http://support

  14. Dezember HotFix Update The December cumulative update for WSS V3 and MOSS 2007 WSS Download http://support.microsoft.com/hotfix/KBHotfix.aspx?kbnum=960010&amp;kbln=en-us

  15. Dezember HotFix Update The December cumulative update for WSS V3 and MOSS 2007 WSS Download http://support.microsoft.com/hotfix/KBHotfix.aspx?kbnum=960010&amp;kbln=en-us

Skip to main content