net3:Button的CommandName使用,AdRotator,BulletedList的使用
原文发布时间为: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的使用的更多相关文章
- ASP.NET中Button控件的CommandName和CommandArgument属性用法
在Repeater中的使用: <asp:Repeater ID="rptActionList" runat="server" OnItemCommand= ...
- 关于Button控件的CommandName属性用法的一个实例
注:本文分享于悠闲的博客,地址:http://www.cnblogs.com/9999/archive/2009/11/24/1609234.html 1.前台的代码 <%@ Page Lang ...
- Gridview中几个Button的应用
gridview中有三种方式添加button的应用,CommandField.ButtonField.TemplateField中加Button这三种方式.三种方式都可以实现同样的功能,但在实现某些功 ...
- 服务器控件和 viewstate
//不会产生处理回发事件的方法.类似客户端html Repeater rep = new Repeater(); DataList dtl = new DataList(); FileUpload f ...
- ASP.NET数据绑定控件简介
•数据绑定分为数据源和数据绑定控件两部分(①数据绑定控件通过数据源获取和修改数据②数据绑定控件通过数据源隔离数据提供者和数据使用者)数据绑定控件→数据源→数据库•数据源:SqlDataSource(连 ...
- 【转载】onclick与onCommand的区别
这两个事件没有本质区别,都是点击执行一个事件.不同在于传递的参数不一 样,OnClick (object sender, EventArgs e),OnCommand (object sender, ...
- asp.net学习之DataList控件
asp.net学习之DataList控件 DataList控件与Repeater控件一样由模板驱动,与Repeater控件不同的是: DataList控件默认输出是一个HTML表格.DataLis ...
- GridView事件分析
GridView事件分析 (转) P1默认数据绑定过程 编号 事件名称 作用 E1 DataBinding 数据绑定之前触发,在这个事件之前(第一次生成GridView),GridView不存在行数据 ...
- ASP.net 自定义控件GridView
using System; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls ...
随机推荐
- UVA 10003 cuting sticks 切木棍 (区间dp)
区间dp,切割dp[i][j]的花费和切法无关(无后效性) dp[i][j]表示区间i,j的花费,于是只要枚举切割方法就行了,区间就划分成更小的区间了.O(n^3) 四边形不等式尚待学习 #inclu ...
- iOS perform action after period of inactivity (no user interaction)
代码看完后感觉非常优秀 http://stackoverflow.com/questions/8085188/ios-perform-action-after-period-of-inactivity ...
- android stuido ndk 开发
开发环境: Android studio 1.0.2 ndk android-ndk-r10d-windows-x86_64 ------------------------------------ ...
- iOS开发遇到的坑之四--图片命名不规范
最近上手并主导一个小项目的研发,在开发地图模块的时候,UI切图给我们使用,他给的图片命名是1.1.1.png 1.1.2.png 1.1.3.png 我也没有多看,就直接打包发给小组成员叫他添加到Im ...
- Linux 中 MySQL 授权远程连接
说明:当别的机子(IP )通过客户端的方式在没有授权的情况下是无法连接 MySQL 数据库的,如果需要远程连接 Linux 系统上的 MySQL 时,必须为其 IP 和具体用户进行授权.一般 root ...
- 文件操作-cp
Linux cp命令 也是我们在实际使用中非常常用的一个命令,主要用来复制文件.文件夹等.今天就来给大家介绍下 cp命令 的使用. 转载自 https://www.linuxdaxue.com/lin ...
- biological clock
'''this application aimed to cauculate people's biological block about emotional(28), energy(23),int ...
- shell-code-5-函数
# 函数必须在使用前定义 # 如果不写return,将以最后一条命令运行结果,作为返回值. return后跟数值n(0-255) myFistFunc(){ read a read b return ...
- Linux 权限设置和 SUID, SGID 以及粘滞位sticky bit
suid是指在执行suid程序的过程中,去访问其他文件时拥有suid程序属主的权限,而不是指对suid程序本身拥有suid程序属主的权限! 一. Linux 文件权限的表示方法 文件权限用 12 个二 ...
- 某比赛小记2- 从HTTP请求返回中获得答案
题目:在A页面登录后,重定向到A页面,然后访问B页面,header中带一指定内容"Content":"2018",然后从response中读取answer的值. ...