title: noCAPTCHA reCAPTCHA disappearing in UpdatePanel
body: <p>I'm implementing noCAPTCHA reCAPTCHA into an existing form with VB.Net. It is located within an UpdatePanel and uses server side validation to verify the user has completed the CAPTCHA (See <a href="https://stackoverflow.com/questions/27764692/validating-recaptcha-2-no-captcha-recaptcha-in-asp-nets-server-side">Validating Recaptcha 2 (No CAPTCHA reCAPTCHA) in ASP.NET&#39;s server side</a>) </p>
  
  <p>If a user fails to the CAPTCHA or any other of the validated fields, the CAPTCHA fails to reload due to postback. How do resolve this and make it so that the CAPTCHA does not disappear after a postback?</p>
  
  <p>My CAPTCHA code:</p>
  
  <pre><code>&lt;div id="captcha" class="g-recaptcha" runat="server" data-sitekey="MySiteKey"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>The api.js is placed in the Site.Master header.</p>
  
  <pre><code>&lt;script src="https://www.google.com/recaptcha/api.js" async defer&gt;&lt;/script&gt;
  </code></pre>
  
  <p>To expand.</p>
  
  <p>I have tried a work around but ultimately failed. I added</p>
  
  <pre><code>&lt;div id="captcha" class="g-recaptcha" runat="server" data-sitekey="MySiteKey"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>to the body of my MasterPage and threw it in an UpdatePanel, gave it an id, etc.                                </p>
  
  <pre><code>    &lt;asp:UpdatePanel UpdateMode="Conditional" runat="server" ID="noCaptcha"&gt;
          &lt;ContentTemplate&gt;
              &lt;asp:ScriptManager runat="server"&gt;&lt;/asp:ScriptManager&gt;
              &lt;script src="https://www.google.com/recaptcha/api.js" async defer&gt;&lt;/script&gt;
          &lt;/ContentTemplate&gt;
      &lt;/asp:UpdatePanel&gt;
  </code></pre>
  
  <p>I then created a function in the code-behind of the Site Master as follows: </p>
  
  <pre><code>Public Sub TriggerCaptchaReload()
      noCaptcha.Update()
  End Sub
  </code></pre>
  
  <p>When the user tried to verify and submit the form </p>
  
  <p>If they failed I attempted to cause the update panel to refresh with </p>
  
  <pre><code>CType(Me.Page.Master, MasterPage).TriggerCaptchaReload()
  </code></pre>
  
  <p>which is located on the control code behind.</p>
  
  <p>This didn't work. Maybe there is a potential solution to find with that?</p>