AdControl.CountryOrRegion property
Gets or sets the user’s two-letter country or region code.
Syntax
public string CountryOrRegion { get; set; }
Property value
Type: System.String.
The user’s two-letter country or region code.
Remarks
The CountryOrRegion property is global and applies to every AdControl in an app. When set multiple times, even on different AdControl objects, the last set value is used for all AdControl objects.
The CountryOrRegion value is null by default. Use the RegionInfo class to obtain the current country or region. The following is an example of how to set the property.
adControl.CountryOrRegion = RegionInfo.CurrentRegion.TwoLetterISORegionName;
The country or region code is a two-letter code defined in ISO 3166. For the current list of values for country or region codes, see English country names and code elements on the ISO Web site.
Exceptions
| Exception | Condition |
|---|---|
|
Invalid country or region code. |
Requirements
| Minimum supported phone | Windows Phone 8 Silverlight |
|---|---|
| Namespace | Microsoft.Advertising.Mobile.UI |
| Assembly | Microsoft.Advertising.Mobile.UI.dll |