Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

trying to add recaptcha to an existing asp.net c# website

Posted on 2012-03-13
10
Medium Priority
?
810 Views
Last Modified: 2012-03-14
I have an existing website for a client which uses asp.net c# mainly due to logic for a side menu that was probably made from a template.  Recently they experienced unwanted spam from their online form and so we found a solution in google's recaptcha to add in order to further prevent this, so now I have the task to make it work as desired.

I followed the instructions as diligently at http://code.google.com/apis/recaptcha/docs/aspnet.html and got my source code to work within visual studio on my local workstation and got this example so it had no errors nor warning messages at least.  Great, I have helloworldc.aspx (see attached text file though keys are masked for security) and Bin/recaptcha.dll which I thought I could just upload to my web server via ftp, but now when I try to use the same code over on http://www.bhhlegal.com/helloworldc.aspx it blows some error messages that I don't quite get it.

While I understand in visual studio, just like doing a c#, that I need to add references to necessary dll files such as recaptcha.dll, but I'm lost as to where or what I have to do in my web server's IIS or web.config or something just to make recaptcha.dll available for our intended purposes.  

Please advise so I can at least get this done, thanks.
helloworldc.txt
0
Comment
Question by:accucom
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
10 Comments
 
LVL 7

Expert Comment

by:markmiddlemist
ID: 37719229
Can you post up the actual web.config (obviously with connection strings removed), or at least the System.Web section please?
0
 

Author Comment

by:accucom
ID: 37720093
Currently, the web.config file only contains the following for debugging purposes:

<configuration>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
</configuration>

there's a library.cs file which basically works off a designed template for side menu purposes.
0
 
LVL 7

Accepted Solution

by:
markmiddlemist earned 1500 total points
ID: 37720773
OK, well I'd try doing what its saying about the httphandlers section under system.web

That will mean your config should become:

<configuration>
    <system.web>
        <customErrors mode="Off"/>
       <httpHandlers>
           <add path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" validate="True" />
       </httpHandlers>
    </system.web>
</configuration

Let me know what it says after doing this.
0
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 

Author Comment

by:accucom
ID: 37720837
by updating the web.config file, I now get the following screen message when I click on my page:

Server Error
500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.

The IIS log file shows as
2012-03-14 15:44:32 192.168.10.34 GET /helloworldc.aspx - 80 - 192.168.10.157 Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 500 23 50 187

I had tried restarting the IIS for that site and still got same thing.
0
 
LVL 7

Expert Comment

by:markmiddlemist
ID: 37721010
Do you have access to the event log on the server? If so it may contain more detail on what the actual error is
0
 

Author Comment

by:accucom
ID: 37721238
Yes I do, am not sure where under Event Viewer (Local) or elsewhere I should be looking at in particular.  

I also ran my wireshark utility and saw a few lines that said the following when I click again onto my helloworldc page:

HTTP   416 GET /helloworldc.aspx HTTP/1.1
HTTP  1434 HTTP/1.1 500 Internal Server Error (text/html)
0
 
LVL 7

Expert Comment

by:markmiddlemist
ID: 37722597
It'll be the Application event log you will need to look in, and you'll be looking for error events (with the red cross) at the right time - as you can reliably reproduce the issue its usually worth triggering it so there are entries at/near the top of the list, which is in descending chronological order.

I can't remember off the top of my head whether the events show as coming from IIS or asp.net (I think its the latter).
0
 

Author Comment

by:accucom
ID: 37722903
Hmmm, interesting, I just tried my helloworldc.aspx link from home and remotely to my office workstation and it now works.  am perplexed as to why I got the error 500 at first but now it works.  Hopefully I can add this to the form tomorrow successfully.
0
 

Author Closing Comment

by:accucom
ID: 37722907
Not sure why it now works, but it works at least.  Hopefully it will work again tomorrow when I return to the office to proceed with the real form.
0
 

Author Comment

by:accucom
ID: 37722929
also I just found out the following from my peer:

I changed the application pool for bhhlegal from “integrated” to “classic”. It seems works now.
I read online that coldfusion8 changes a mapping that causes integrated mode not to work.
Not sure if you changed anything with asp.net or the web.config.
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Lync server 2013 or Skype for business Backup Service Error ID 4049 – After File Share Migration
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question