Search code examples
asp.netmodel-view-controllerknockout.jsumbracorecaptcha

Get grecaptcha in knockout viewmodel asp.net mvc umbraco


I am trying to use google's recaptcha in my web site(Umbraco). The problem I am facing is that I can not use grecaptcha in my viewmodel.

So far, I have included into my _Layout.cshtml

<script src='https://www.google.com/recaptcha/api.js'></script>

But when I try to access grecaptcha in view model I get

cannot resolve symbol grecaptcha

error. So I can't do any of actions related to captcha.


Solution

  • I ended up with grecapctha.reset() on view, not viemodel