Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net reCaptcha、.NET、Chrome:不工作的组合_Asp.net_Google Chrome_Webforms_Recaptcha - Fatal编程技术网

Asp.net reCaptcha、.NET、Chrome:不工作的组合

Asp.net reCaptcha、.NET、Chrome:不工作的组合,asp.net,google-chrome,webforms,recaptcha,Asp.net,Google Chrome,Webforms,Recaptcha,我遇到了一个问题,我想与大家分享,这既是为了记录,也是为了找到一个合适的解释。问题是:reCaptcha停止显示,因此无法工作,但只能在Chrome上工作 环境 这是一个使用.NET3.5、WebForms和官方reCaptcha库reCaptcha.web.dll构建的网站 实施 然后,在提交时,我使用CustomValidator控件检查该控件 输出 除Chrome浏览器外,每个浏览器都会显示一个recaptcha框,其中留有空白。如果我尝试提交表单,将显示.NET服务器错误,说明: Rec

我遇到了一个问题,我想与大家分享,这既是为了记录,也是为了找到一个合适的解释。问题是:reCaptcha停止显示,因此无法工作,但只能在Chrome上工作

环境

这是一个使用.NET3.5、WebForms和官方reCaptcha库reCaptcha.web.dll构建的网站

实施

然后,在提交时,我使用CustomValidator控件检查该控件

输出

除Chrome浏览器外,每个浏览器都会显示一个recaptcha框,其中留有空白。如果我尝试提交表单,将显示.NET服务器错误,说明:

Recaptcha质询字段不能为空

弗尔分析

深入调试,我了解了dll的实际工作方式:它注入了一个引用http://www.google.com/recaptcha/api/challenge?k=MY_PUBLIC_KEY. 因此,核心问题似乎是Chrome和xss或脚本注入之间的问题。在谷歌上搜索,我什么也找不到。更重要的是,Chrome控制台没有显示任何关于它的错误/警告/信息。

我的幸运、松散的解决方案

在我对这个问题感到沮丧之后,我做了一些既琐碎又愚蠢的事情:我硬编码了一个引用http://www.google.com/recaptcha/api/challenge?k=MY_PUBLIC_KEY 我是在调试时发现的。直接在第页。它按预期工作:它在我放置标记的确切位置显示一个reCaptcha控件。但有趣的是:在我删除硬编码后,整个页面工作正常,在其他机器上也一样

这就是所有的人,我希望它能帮助其他人。如果你能向我解释一下到底发生了什么,那就不客气了

<%@ Register Namespace="Recaptcha.Web.UI.Controls" Assembly="Recaptcha.Web" TagPrefix="cc1" %>
<cc1:Recaptcha id="RecaptchaControl" runat="server" />