net3:DropDownList的动态绑定
原文发布时间为:2008-07-29 —— 来源于本人的百度文章 [由搬家工具导入]
using System.Data;
using System.Configuration;
using System.Collections;
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 Default3 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
ArrayList name = new ArrayList();
name.Add("lily");
name.Add("lucy");
name.Add("lilei");
DropDownList1.DataSource = name;
DropDownList1.DataBind();
}
}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
switch (DropDownList1.SelectedValue)
{
case "lily":
Label1.Text = "lily a";
break;
case "lucy":
Label1.Text = "lucy b";
break;
case "lilei":
Label1.Text = "lilei c";
break;
}
}
protected void Button1_Click(object sender, EventArgs e)
{
string add = TextBox1.Text;
DropDownList4.Items.Add(add);
}
}
最新文章
- BPM配置故事之案例10-获取外部数据
- 干货|宏巍软件之Java线程监控之旅
- A.Kaw矩阵代数初步学习笔记 10. Eigenvalues and Eigenvectors
- 51nod1264线段相交
- JAVA多线程解惑之多线程返回值
- 解读oracle执行计划-待续
- [转]Windows Shell 编程 第九章 【来源:http://blog.csdn.net/wangqiulin123456/article/details/7987969】
- C++中引用用于结构
- c++ - Create empty json array with jsoncpp - Stack Overflow
- pyfits 读取bintable
- 深入了解Bundle和Map
- rocketmq 4.3.2 解决远程不能消费问题,解决未识别到公网IP问题
- 2^n算法
- linux 定时任务 日志记录
- camtasis studio 未能创建视频内存资源。
- opencv2函数学习之threshold:实现图像阈值化
- 【Reporting Services 报表开发】— 如何根据明细的行数实现分页(比如每隔5行分页)
- jenkins 定时构建 位置
- [bzoj1875][SDOI2009] HH去散步 [dp+矩阵快速幂]
- Mongodb安全认证及Java调用