techspider techspider - 2 months ago 24
ASP.NET (C#) Question

Google reCaptcha doesn't show up on IE

I am using reCAPTCHA Version 2.1.0 for .NET

NuGet Package
with
recaptcha Api Version 2
.

Assembly Registration on the
ASPX
page:

<%@ Register Assembly="Recaptcha.Web" Namespace="Recaptcha.Web.UI.Controls" TagPrefix="cc1" %>


My HTML:

<div style="margin-top: 10px; transform: scale(0.99); transform-origin: 0;
-ms-transform: scale(0.99); -ms-transform-origin: 0;
-webkit-transform: scale(0.99); -webkit-transform-origin: 0;
align-content: center;">
<cc1:Recaptcha ID="recaptcha" runat="server" Theme="Clean" Width="400" />
</div>


The captcha shows up on
Firefox
and
Chrome
, but doesn't show up
IE
. I have tried on IE 10 and 11 and it doesn't display in any version of IE.

My attempts:


  • I added
    -ms-transform
    and
    transform
    CSS properties on the DIV

  • I checked the solution shown on Google Support page but it is not even in my Compatibility Settings.

  • I checked the solution shown on MSDN Forum by enabling
    Turn off Data URI support
    .

  • I checked a number of posts on SO



But, none of them helped me. It would be great, if anyone could point me in the right direction.

A note:

It shows up captcha control in IE when I run the application through Visual Studio under localhost. It doesn't show the control from the deployed version on IIS. No issues with Firefox and Chrome. The site is on
HTTPS
, if it makes any difference.

Answer

This turns out to be a group policy enforced in the company. The group policy forces all intranet pages to be rendered in IE with

Browser Mode: IE10 Compat View Document Mode: IE7 standards

In order to override this policy, I have added X-UA-Compatible in Headers.

<httpProtocol>
  <customHeaders>
    <add name="X-UA-Compatible" value="IE=Edge" />
  </customHeaders>
</httpProtocol>

Just a note for others that I have tried adding the same in meta tag of header section, but it didn't work.