如何:以编程方式在 AdRotator Web 服务器控件中选择广告
来源:互联网 发布:手机淘宝秒杀要刷新吗 编辑:程序博客网 时间:2024/05/02 00:09
使用 AdRotator Web 服务器控件,可以通过在 AdCreated 事件处理程序中创建自定义逻辑来动态选择广告。
使用 AdCreated 事件选择广告
-
为 AdRotator 控件创建 AdCreated 事件处理程序。
在该处理程序中传递的第二个参数包含对要创建的广告的引用。
-
设置广告对象的属性,以指定要显示的广告的图像和定位 URL。
下面的示例演示如何设置 AdCreatedEventArgs 控件的 ImageUrl、NavigateUrl 和 AlternateText 属性:
Visual Basic复制代码Public Sub AdRotator1_AdCreated(ByVal sender As Object, _ ByVal e As System.Web.UI.WebControls.AdCreatedEventArgs) _ Handles AdRotator1.AdCreated e.ImageUrl = "images/contoso_ad.gif" e.NavigateUrl = "http://www.contoso-ltd.com/" e.AlternateText = "Ad for Contoso, Ltd. Web site"End Sub
C#复制代码protected void AdRotator1_AdCreated (object sender, System.Web.UI.WebControls.AdCreatedEventArgs e){ e.ImageUrl = "images/contoso_ad.gif"; e.NavigateUrl = "http://www.contoso-ltd.com/"; e.AlternateText = "Ad for Contoso, Ltd Web site";}
- 如何:以编程方式在 AdRotator Web 服务器控件中选择广告
- 如何:使用 AdRotator Web 服务器控件显示数据库中的广告
- 如何:使用 AdRotator Web 服务器控件显示 XML 文件中的广告
- 使用 AdRotator Web 服务器控件显示 XML 文件中的广告
- 广告控件(AdRotator)
- 学习Adrotator广告控件
- 广告控件(AdRotator)使用方法
- AdRotator广告控件
- ASP.NET - AdRotator Web 服务器控件概述
- Web服务器控件介绍系列(1)----AdRotator
- 在ASP.NET中使用AdRotator控件
- 在ASP.NET中使用AdRotator控件
- ASP.NET--Adrotator广告控件中XML文件的格式
- ASP.NET中广告控件AdRotator的使用方法
- ASP.NET中广告控件AdRotator的使用方法。
- ASP.NET 中 AdRotator(广告控件)的使用
- ASP.NET 中 AdRotator(广告控件)的使用
- 如何在Windows NT中以编程方式管理用户权限
- J2EE体系结构设计
- 自己写的针对xml操作的类
- ActionScript 3.0 Cookbook 6.2 从显示列表中移除项目(翻译:转载请注明)
- 待阅:20070808(未阅)
- AspNetPager分页控件
- 如何:以编程方式在 AdRotator Web 服务器控件中选择广告
- 用J2EE架构企业级应用
- 架构设计的三个维度
- 只爱一点点
- 综合纳税服务平台的设计
- 快速适应需求变化的软件复用
- 中间件技术及其应用
- 笑话
- 演练:使用 AdRotator 控件显示和跟踪广告