原文发布时间为:2008-07-29 —— 来源于本人的百度文章 [由搬家工具导入]

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        switch (((Button)sender).CommandName)
        {
            case "a":
                Label1.Text = "aaa";
                break;
            case "b":
                Label1.Text = "bbb";
                break;

            case "c":
                Label1.Text = "ccc";
                break;
        }
    }
    protected void a(object sender, CommandEventArgs e)
    {

    }
    protected void AdRotator1_AdCreated(object sender, AdCreatedEventArgs e)
    {
        string url = e.AlternateText;
        string sdate = e.AdProperties["Sdate"].ToString();
        string edate = e.AdProperties["Edate"].ToString();
        Response.Write(url + "start date:" + sdate + ",end date:" + edate);
    }
    protected void BulletedList2_DataBound(object sender, EventArgs e)
    {
        for (int i = 0; i < BulletedList2.Items.Count; i++)
        {
            BulletedList2.Items[i].Value = "http://www." + BulletedList2.Items[i].Value + ".com";
        }

    }

    protected void BulletedList3_Click(object sender, BulletedListEventArgs e)
    {
        Response.Write("<br>"+BulletedList3.Items[e.Index].Value);
    }
}

----------------------------

广告控件的XML文档 Ad.XML内容:

<?xml version="1.0" encoding="utf-8"?>
<Advertisements>
<Ad>
    <ImageUrl>~/image/baidu.gif</ImageUrl>
    <NavigateUrl>http://www.baidu.com</NavigateUrl>
    <AlternateText>baidu</AlternateText>
    <Keyword>baiduzhidao</Keyword>
    <Impressions>50</Impressions>
    <Sdate>6/23/2008</Sdate>
    <Edate>6/29/2008</Edate>
</Ad>
<Ad>
    <ImageUrl>~/image/google.gif</ImageUrl>
    <NavigateUrl>http://www.google.com</NavigateUrl>
    <AlternateText>google</AlternateText>
    <Keyword>google gou</Keyword>
    <Impressions>30</Impressions>
    <Sdate>6/23/2008</Sdate>
    <Edate>7/23/2008</Edate>
</Ad>
<Ad>
    <ImageUrl>~/image/iask.gif</ImageUrl>
    <NavigateUrl>http://www.iask.com</NavigateUrl>
    <AlternateText>iask</AlternateText>
    <Keyword>aiwen</Keyword>
    <Impressions>50</Impressions>
    <Sdate>7/1/2008</Sdate>
    <Edate>9/23/2008</Edate>
</Ad>
</Advertisements>

net3:Button的CommandName使用,AdRotator,BulletedList的使用的更多相关文章

  1. ASP.NET中Button控件的CommandName和CommandArgument属性用法

    在Repeater中的使用: <asp:Repeater ID="rptActionList" runat="server" OnItemCommand= ...

  2. 关于Button控件的CommandName属性用法的一个实例

    注:本文分享于悠闲的博客,地址:http://www.cnblogs.com/9999/archive/2009/11/24/1609234.html 1.前台的代码 <%@ Page Lang ...

  3. Gridview中几个Button的应用

    gridview中有三种方式添加button的应用,CommandField.ButtonField.TemplateField中加Button这三种方式.三种方式都可以实现同样的功能,但在实现某些功 ...

  4. 服务器控件和 viewstate

    //不会产生处理回发事件的方法.类似客户端html Repeater rep = new Repeater(); DataList dtl = new DataList(); FileUpload f ...

  5. ASP.NET数据绑定控件简介

    •数据绑定分为数据源和数据绑定控件两部分(①数据绑定控件通过数据源获取和修改数据②数据绑定控件通过数据源隔离数据提供者和数据使用者)数据绑定控件→数据源→数据库•数据源:SqlDataSource(连 ...

  6. 【转载】onclick与onCommand的区别

    这两个事件没有本质区别,都是点击执行一个事件.不同在于传递的参数不一 样,OnClick (object sender, EventArgs e),OnCommand (object sender, ...

  7. asp.net学习之DataList控件

    asp.net学习之DataList控件   DataList控件与Repeater控件一样由模板驱动,与Repeater控件不同的是: DataList控件默认输出是一个HTML表格.DataLis ...

  8. GridView事件分析

    GridView事件分析 (转) P1默认数据绑定过程 编号 事件名称 作用 E1 DataBinding 数据绑定之前触发,在这个事件之前(第一次生成GridView),GridView不存在行数据 ...

  9. ASP.net 自定义控件GridView

    using System; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls ...

随机推荐

  1. CPP-基础:wchar_t

    目 录 1简介 2例如 3将char转换成wchar_t 1.简介 wchar_t是C/C++的字符数据类型,是一种扩展的字符存储方式,wchar_t类型主要用在国际化程序的实现中,但它不等同于uni ...

  2. WINDOWS-API:API函数大全

    操作系统除了协调应用程序的执行.内存分配.系统资源管理外,同时也是一个很大的服务中心,调用这个服务中心的各种服务(每一种服务是一个函数),可以帮肋应用程序达到开启视窗.描绘图形.使用周边设备的目的,由 ...

  3. PAT (Basic Level) Practise (中文)-1033. 旧键盘打字(20)

    PAT (Basic Level) Practise (中文)-1033. 旧键盘打字(20)  http://www.patest.cn/contests/pat-b-practise/1033 旧 ...

  4. 新建Maven工程,pom.xml报错web.xml is missing and <failOnMissingWebXml> is set to true

    错误原因: 项目中没有web.xml 解决办法: 在项目中添加web.xml 在pom.xml中添加下面的插件 <build> <plugins> <plugin> ...

  5. NOIP 2017 图书管理员

    题目描述 图书馆中每本书都有一个图书编码,可以用于快速检索图书,这个图书编码是一个 正整数. 每位借书的读者手中有一个需求码,这个需求码也是一个正整数.如果一本书的图 书编码恰好以读者的需求码结尾,那 ...

  6. (2)zabbix硬件需求

    1. 硬件需求 无非就是cpu.内存.硬盘之类的1.1 CPU由你的zabbix数据库使用情况来做决定,如果你监控的项目越多,那你的cpu要越好.具体多好,下面有个表格 1.2 内存与硬盘最基本的需求 ...

  7. centos7系统优化

    优化说明: 一.关闭selinux 二.更改为阿里yum源 三.提权dm用户可以使用sudo 四.优化ssh远程登录配置 五.设置中文字符集 六.设置时间同步 七.历史记录数及登录超时环境变量设置 八 ...

  8. 编写testplan

    编写验证计划是验证工作核心技能.衡量标准是完备性.可是写一个完备的验证计划,才开始不是一件容易的事情,需要不断的练习实践. 1.验证计划主要从设计的futurelist中提取.     复杂的futu ...

  9. Template--模板

    模板引擎的支持 配置 模板引擎配置为TEMPLATES设置.这是一个配置列表,每个引擎一个,默认值为空.这是settings.py生成的,通过startproject命令定义了一个更有用的值: TEM ...

  10. stm32L011F3——串口实例

    /* STM32L0xx HAL library initialization: - Configure the Flash prefetch, Flash preread and Buffer ca ...