Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

AdControl Constructor - Windows 8.1

Microsoft Advertising Services

Updated: October 17, 2013

Published: April 1, 2014

Syntax

JavaScript

var myAdControl = new MicrosoftNSJS.Advertising.AdControl(adDiv, { applicationId: "d25517cb-12d4-4699-8bdc-52040c712cab", adUnitId: "10043107" });

The first parameter takes the DIV value that will host the AdControl on the HTML page. For more information see the topic Creating the AdControl in JavaScript

HTML

<div id="myAd" style="width:250px; height:250px"

data-win-control="MicrosoftNSJS.Advertising.AdControl"

data-win-options="{applicationId: 'd25517cb-12d4-4699-8bdc-52040c712cab', adUnitId: '10043107' }" >

</div>

For a walkthrough about creating the AdControl in HTML see the topic HTML 5 (JavaScript)

XAML

<my:AdControl x:Name="AdControl1" ApplicationId="d25517cb-12d4-4699-8bdc-52040c712cab" AdUnitId="10043107" Width="250" Height="250" />

For an example of creating the AdControl in XAML see the Developer Walkthrough - XAML.

Place the AdControl in the Main Frame

Do not place the AdControl in an iFrame. Certain ad types have click-to-actions that can open in full screen mode. Users would have a negative experience with your app if an ad is shown in an iFrame that does not accommodate the click-to-action.

The AdControl will throw an error if it is loaded in an iFrame and will not show an ad.

Support and Feedback

Get product support or report a bug in the advertising SDK by visiting the Windows Store Apps developer support page support page. For product support, under "App development" click the "Advertising SDK" link. To post a question in the support forum, scroll down to "Find answers online" and click "Ads-in-Apps for Windows 8 forum".

Send feedback about this documentation to adsfdbk@microsoft.com. There is no product support through this alias. Documentation feedback only.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.