最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

c# - Change the theme of Recaptcha? - Stack Overflow

programmeradmin1浏览0评论

I use the Following script for change recaptcha in asp with c# server side.But this code Didn't Work.How to change color or theme of the ReCaptcha?

 <script type="text/javascript">
            var RecaptchaOptions = {theme : 'White'};
       </script>

I use the Following script for change recaptcha in asp with c# server side.But this code Didn't Work.How to change color or theme of the ReCaptcha?

 <script type="text/javascript">
            var RecaptchaOptions = {theme : 'White'};
       </script>
Share Improve this question asked Nov 19, 2012 at 9:16 V.VV.V 8833 gold badges25 silver badges56 bronze badges 1
  • 1 The theme name is 'white' not 'White' note the capital. – Ryan McDonough Commented Nov 19, 2012 at 9:22
Add a ment  | 

4 Answers 4

Reset to default 3

I think you are just writing the name of the theme in wrong way, just try White with a small 'w'.

<script type="text/javascript">
            var RecaptchaOptions = {theme : 'white'};
</script>

See this link for exact working code:

https://developers.google./recaptcha/docs/customization

George Siggouroglou's second method for asp is a charm

I couldn't seem to set the theme as instructed in https://developers.google./recaptcha/docs/customization - placed the js above the form containing the recaptcha control - but adding the theme attribute directly into the recaptcha code as George explained:

<recaptcha:RecaptchaControl
    ID="recaptcha"
    runat="server"
    PublicKey="your-public-key"
    PrivateKey="your-private-key"
    Theme="white"
/>

works.

U used the capital W instead of small i.e. w Try this

Change the theme and try

<script type="text/javascript">
 var RecaptchaOptions = {
    theme : 'white'
    /*WE CAN USE FOLLOWING THEME TO CHANGE THE COLOR OF RECAPTHCA*/
    /*red,white,blackglass,clean'*/

    /*lang :'es';*/ //used to set the language
 };
 </script>

If you are using asp and if you are using the recapctcha for asp control, then if you want to change the theme (red(default),white,blackglass,clean) there is two ways.

Way no1,

To make the reCAPTCHA widget display a different theme, you first need to add the following
code in your main HTML page anywhere before the element where reCAPTCHA appears
(this will not work if placed after the main script where reCAPTCHA is first invoked):

<script type="text/javascript">
    var RecaptchaOptions = {
        theme : 'theme_name'
    };
</script>

Way no2:

Add the property 'Theme' to the recapcha asp control:

<recaptcha:RecaptchaControl
    ID="recaptcha"
    runat="server"
    PublicKey="your-public-key"
    PrivateKey="your-private-key"
    Theme="white"
/>
发布评论

评论列表(0)

  1. 暂无评论