MSDN Library

AdControl (String, String, Boolean)

This constructor is deprecated. Set each property’s value directly using that property’s set method.

Instantiates a new AdControl by using the provided parameters.

Namespace: Microsoft.Advertising.Mobile.UI

Assembly: Microsoft.Advertising.Mobile.UI (in Microsoft.Advertising.Mobile.UI.dll) Version: 6.1.909.0

public AdControl(
 string applicationId,
 string adUnitId,
 bool isAutoRefreshEnabled



Name Description Type


Identifies the app. This value is assigned to you during the publisher registration process. For more information, see Getting Access to Microsoft pubCenter and Receiving Ads.



The ad unit identifier for this AdControl instance. This value is set in pubCenter as part of the ad unit’s configuration. For more information, see Getting Access to Microsoft pubCenter and Receiving Ads.



Enables or disables automatic ad refresh. This is enabled by default.


This is the alternative constructor for an AdControl object. When initalized, the AdControl is configured to show either a banner ad or a text ad.

The default AdControl size is 480 x 80 pixels. The size property is inherited from the UserControl class.

Live ads are not available in the emulator. You must use test values for the ApplicationId and AdUnitId when running in the emulator. To verify live ads you will have to run the app on a device. If the ApplicationId is NOT set to the value test_client when the app is running in the emulator, the app will throw an error with the following message. "You can not use pubCenter IDs for testing from the emulator. If you want to test with these IDs please deploy your application to a device. Otherwise please change your ApplicationId to test_client and AdUnitId to one of the supported ad types as outlined in the documentation." For more information see the topic Test Values for AdUnitId and ApplicationId.

Windows Phone 7.x, Windows Phone 8

Send feedback about this documentation to
Publication date: 2012-10-30

Community Additions

© 2015 Microsoft