Share via


ReCaptcha.PublicKey Property

Gets or sets the public key for the reCAPTCHA service.

Namespace:  Microsoft.Web.Helpers
Assembly:  Microsoft.Web.Helpers (in Microsoft.Web.Helpers.dll)

Syntax

'Declaration
Public Shared Property PublicKey As String
    Get
    Set
'Usage
Dim value As String

value = ReCaptcha.PublicKey

ReCaptcha.PublicKey = value
public static string PublicKey { get; set; }
public:
static property String^ PublicKey {
    String^ get ();
    void set (String^ value);
}
static function get PublicKey () : String
static function set PublicKey (value : String)

Property Value

Type: System.String
The public key.

Remarks

You use the reCAPTCHA public key by passing it as a parameter to the methods that render the reCAPTCHA control (GetHtml(String, String, String, Int32) and GetHtmlWithOptions(String, Object)). Alternatively, because the public key is a static value, you can set the PublicKey property in the _AppStart.cshtml page of your Web site.

Note

You can obtain a public key by signing up for the reCAPTCHA service (https://www.recaptcha.net).

Permissions

  • Medium trust for the immediate caller. This member can be used by partially trusted code.

See Also

Reference

ReCaptcha Class

Microsoft.Web.Helpers Namespace