Went through interesting experience in implementing the adcontrol in Windows Phone 7 and I thought I will share it here.
First go and register your application in
This site gives you the following steps
- Register mobile application
- Create application ad unit
- Download the Microsoft Advertising SDK for Windows Phone 7
- Integrate the Microsoft Advertising SDK for Windows Phone 7 into your application.
- Manage your existing applications and ad units
In the XAML insert the ad control
<StackPanel Grid.Row="5" x:Name="SP_ADControl" Visibility="Visible" >
<ad:AdControl RotationEnabled="True" AdModel="Contextual" Width="450" Height="80"
AdUnitId="your adunit id" ApplicationId="your application id" />
<!--<ad:AdControl Width="450" Height="80"
AdUnitId="TextAd" ApplicationId="test_client" />-->
In my application Grid.Row=”5” is the bottom portion of the screen. Do not forget to pu your own ApplicationID and AdUnitId. The commented out portion is what you can use to test the app without getting an app id from the pub center.
In the Xaml.cs file put the following in the code right after InitializeComponent();
SP_ADControl.Visibility = Visibility.Collapsed;
SP_ADControl.Visibility = Visibility.Visible;
AdControl.TestMode = false;
Add this method to the code
private bool CheckIsTrial()
MessageBoxResult result = MessageBox.Show
("CLICK OK TO SIMULATE FULL LICENSE", "BUY NOW!", MessageBoxButton.OKCancel);
if (result == MessageBoxResult.OK)
This would help to test the app in the debug mode by showing you a dialog to test the ap. Check reference 5 given below.
The most interesting line of code is AdControl.TestMode = false; This is required because the Adcontrol.TestMode default value is True! Check reference 1 and 2 on this.
Do not forget to submit the release version to the marketplace.