Ads suddenly missing Outside Pivot Page

Jan 3, 2013 at 11:41 AM
Edited Jan 3, 2013 at 11:43 AM

Hi, i'm trying to implement adsrotator in all of my pivot page. I succeed implementing it in only one pivot item, but when i'm trying to implement it outside pivot control (so it will show in all pivot item). it only show for second and then suddenly missing. Is there anyone here know why it happens that way, and know how to solve it? here is some of my code 

 

<Grid Name="gridPivot" Visibility="Visible">
	<Grid.RowDefinitions
		<RowDefinition Height="*"></RowDefinition>
		<RowDefinition Height="80"></RowDefinition
	</Grid.RowDefinitions>
	<phone:Pivot Title="apps title" LoadingPivotItem="Pivot_LoadingPivotItem_1" Grid.Row="0" Margin="0,0,0,0">
 <!--Pivot item one-->
		<phone:PivotItem Header="Current Goal" Name="currentgoal">
			 <ScrollViewer>
				<!--some control here -->
			</ScrollViewer>
		</phone:PivotItem>
<!--Pivot item two, three etc-->
	</phone:Pivot>
	<adRotator:AdRotatorControl Grid.Row="1" Margin="0,0,0,0" VerticalAlignment="Bottom" x:Name="AdRotatorControl" �HorizontalAlignment="Stretch" Height="80" AdDuplexAppId="12345" InneractiveAppId="Pokobow" DefaultSettingsFileUri="/OneGoal;component/AdsConfiguration.xml" Background="#FFCBFF00"/>
 </Grid>

 

 

Coordinator
Jan 9, 2013 at 11:30 PM

Hmm that does sound Odd, looking at your XAML it seems fine.

Note you only need to configure your AdProvider ID's in either the XAML OR the config XML, not both (we suggest in the config XAML as it's easier to maintain, especially if you host it on a free hosting site like Azure websites or AppHarbour)

Can you confirm you are calling the "invalidate" function for AdRotator in your code behind Loaded event (i'm guessing you are since it worked inside the pivot control)

one suggestion is to add a handler to the AdRotator log event and output it's messages to the DEBUG window to see why it's disabling, usually this is because there are either No ads to serve or the configuration is wrong.

Like this

AdRotator.Log += (s,e) => 
{
    debig.writeline(s);
}

(p.s that's just an example off the top of my head so may not be exact)

 

Other option is to put the AdRotator control in a separate user control and then use that  user control in your page (making sure to call invalidate in the user controls loaded event in the code behind), we usually recommend this as it's much cleaner especially if there are multiple places where you use the control.

Hope this helps.

Jan 10, 2013 at 1:03 PM

Thank you for you response DarkSide,

Hi after reading your feedback, I realized that my xaml is fine so i am focusing in the XML configuration , after i changed the XML configuration to match "http://adrotator.apphb.com/defaultAdSettingsWindows8dev.xml" the ads work AWESOME!.  Once again, Thank you.

Coordinator
Jan 10, 2013 at 4:29 PM

Glad your up and running