Python语言技术文档

微信小程序技术文档

php语言技术文档

jsp语言技术文档

asp语言技术文档

C#/.NET语言技术文档

html5/css技术文档

javascript

点击排行

您现在的位置:首页 > 技术文档 > C#/.NET入门教程

ASP.NET入门教程:广告控件的使用方法

来源:中文源码网    浏览:178 次    日期:2024-04-17 09:31:55
【下载文档:  ASP.NET入门教程:广告控件的使用方法.txt 】


ASP.NET笔记之广告控件的使用方法
广告控件的使用方法:
广告文件是一个XML文件,广告文件中所有的标签属性被分析后放到adProperties字典中,用以属性编辑。
ads.xml复制代码 代码如下: 4rwbgzby.gif //www.zwyuanma.com Text_01 one 40 I'm using adRotator No.1 banner.jpg //www.zwyuanma.com Text_02 two 40 I'm using adRotator No.2 cvtxlkw4.gif //www.zwyuanma.com Text_03 three 30 I'm using adRotator No.3 adRotator.aspx.cs复制代码 代码如下:using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class myTest_advertisement : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void ad_Created(object sender, AdCreatedEventArgs e) { if ((string)e.AdProperties["Animal"] != "") Label1.Text = (string)e.AdProperties["Aniaml"]; else Label1.Text = "n.a."; } }adRotator.aspx复制代码 代码如下:<%@ Page Language="C#" AutoEventWireup="true" CodeFile="adRotator.aspx.cs" Inherits="myTest_advertisement" %> Using adRotator

Adrotator Control

<%--Adrotator文件--%>
Animal:
1、重构菜单:提取方法(Ctrl+R,Ctrl+M) 封装字段(Ctrl+R,Ctrl+F)
2、字典中的关键字是Animal, 该值转化为字符串,
(string).AdProperties["Aniaml"]

相关内容