AdRotator.KeywordFilter Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets a category keyword that you can use to filter advertisements from an advertisement file. The default is an empty string (""). This API is obsolete. For information about how to develop ASP.NET mobile applications, see Mobile Apps & Sites with ASP.NET. This API is obsolete. For information about how to develop ASP.NET mobile applications, see Mobile Apps & Sites with ASP.NET.
public:
property System::String ^ KeywordFilter { System::String ^ get(); void set(System::String ^ value); };
[System.ComponentModel.Bindable(true)]
public string KeywordFilter { get; set; }
[<System.ComponentModel.Bindable(true)>]
member this.KeywordFilter : string with get, set
Public Property KeywordFilter As String
Property Value
The keyword used to identify advertisements within a specific category.
- Attributes
Examples
The following code example demonstrates how to use the KeywordFilter property to set the preference from a collection of images in the file referred by the AdvertisementFile property. For the complete sample code, see the AdRotator class overview.
<!-- The AdRotator control -->
<mobile:AdRotator id="AdControl" runat="server"
ImageKey="MobileImgSrc" NavigateUrlKey="TargetUrl"
AdvertisementFile="App_Data/ads.xml" Alignment="Left"
KeywordFilter="Developer" OnAdCreated="AdCreated_Event">
<DeviceSpecific>
<Choice Filter="isWML11" NavigateUrlKey="WmlTargetUrl"
ImageKey= "WmlImageSrc" />
</DeviceSpecific>
</mobile:AdRotator>
<!-- The AdRotator control -->
<mobile:AdRotator id="AdControl" runat="server"
ImageKey="MobileImgSrc" NavigateUrlKey="TargetUrl"
AdvertisementFile="App_Data/ads.xml" Alignment="Left"
KeywordFilter="Developer" OnAdCreated="AdCreated_Event">
<DeviceSpecific>
<Choice Filter="isWML11" NavigateUrlKey="WmlTargetUrl"
ImageKey= "WmlImageSrc" />
</DeviceSpecific>
</mobile:AdRotator>
Remarks
If the AdvertisementFile property has data and this KeywordFilter property has content, the AdRotator control selects an advertisement with a matching keyword.
If the AdvertisementFile property has data and this KeywordFilter property has content but there is no keyword match between this property and the file, a blank image displays and a trace warning is generated.