ASP.NET Mobile AdRotator Control[转]
Definition and Usage
定义和用法
The AdRotator control is used to display a sequence of ad images in a mobile page.
AdRotator 控件的作用是:显示移动页面中的一组图像序列。
This control uses an XML file to store the ad information. The XML file must begin and end with an <Advertisements> tag. Inside the <Advertisements> tag there may be several <Ad> tags which defines each ad.
该控件使用一个XML文件来存储ad信息。XML文件必须以<Advertisements>标签开始和结束。在<Advertisements>标签内,也可能包含若干个<Ad>标签来定义ad。
The predefined elements inside the <Ad> tag are listed below:
<Ad>标签中的预定义元素列表如下:
| Element 事件 |
Description 描述 |
|---|---|
| <ImageUrl> | Optional. The URL of the image to display 可选参数。显示图像的URL |
| <NavigateUrl> | Optional. The URL of the page to display if the user clicks the ad 可选参数。如果用户点击ad,则显示页面的URL |
| <OptionalImageUrl> | Optional. The URL of a monochrome image to display 可选参数。显示一个单色图像的URL |
| <OptionalNavigateUrl> | Optional. 可选参数 |
| <AlternateText> | Optional. An alternate text for the image 可选参数。指定图像所对应的转换文本 |
| <Keyword> | Optional. A category for the ad (used to filter ads) 可选参数。指定ad目录(用于过滤ad) |
| <Impressions> | Optional. The display rates in percent of the hits 可选参数。指定点击后显示该对象的百分比率 |
Properties
属性
| Property 属性 |
Value 值 |
Description 描述 |
|---|---|---|
| AdvertisementFile | URL | Optional. The path to the XML file that contains ad information 可选参数。指定包含ad信息的XML文件路径 |
| Alignment | left center right |
Optional. How to align the control 可选参数。指定空间的对齐方式 |
| BackColor | rgb(x,x,x) #xxxxxx colorname |
Optional. A background color for the control 可选参数。指定空间的背景色 |
| ForeColor | rgb(x,x,x) #xxxxxx colorname |
Optional. A foreground color for the control 可选参数。指定空间的前景色 |
| Font-Bold | false true |
Optional. Specifies whether or not the text in the control should be bold 可选参数。指定控件中的文本字体是否以粗体显示 |
| Font-Italic | false true |
Optional. Specifies whether or not the text in the control should be italic 可选参数。指定控件中的文本字体是否以斜体显示 |
| Font-Name | fontname | Optional. Specifies the font name of the text in the control 可选参数。指定空间中的文本字体名称 |
| Font-Size | normal small large |
Optional. Specifies the font size of the text in the control 可选参数。指定空间中的文本字体尺寸 |
| id | unique_name | Optional. A unique id for the control 可选参数。为空间指定一个独立的id |
| ImageKey | imagekey | Optional. Specifies the name from which the image URL is retrieved from an ad 可选参数。指定获取图像URL的ad名称 |
| KeywordFilter | filter | Optional. A filter to limit ads after categories 可选参数。指定限制目录之后ad的过滤器 |
| NavigateUrlKey | navigateurlkey | Optional. Specifies the element name from which the target URL is retrieved from an ad 可选参数。指定获取目标URL的ad元素名称 |
| OnAdCreated | function_name | Optional. he name of the function to be executed after the creation of the control, before page rendering 可选参数。指定在提交页面之前,创建控件之后所要执行的函数名称 |
| runat | "server" | Required. Specifies that the control is a server control 必要参数。指定该控件为服务器控件 |
| StyleReference | name_of_style_element | Optional. Specifies a reference to a style to be applied to the control 可选参数。指定一个应用于控件的样式参数 |
| Wrapping | wrap nowrap |
Optional. Specifies whether or not the text in the control should wrap 可选参数。指定控件中的文本是否允许被嵌套 |
Example 1
案例1
The following example contains one form in an .aspx file. The form contains a AdRotator control that will rotate between three images:
下面的案例包含了 .aspx 文件的一张表单。该表单中包含了循环显示三张图片的AdRotator控件:
<%@ Page <Mobile:Form runat="server"> |
This is the ad file called "advertisements.xml":
下面是一个名为“advertisement.xml”的文件:
<?xml version="1.0" ?> <Ad> <Ad> <Ad> </Advertisements> |
浙公网安备 33010602011771号