码迷,mamicode.com
首页 > Web开发 > 详细

net2:DropDownList的使用

时间:2017-07-09 16:02:48      阅读:180      评论:0      收藏:0      [点我收藏+]

标签:opd   down   add   page   web   box   htm   using   weight   

原文发布时间为: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)
    {
        if (!IsPostBack)
        {
            DropDownList1.Items.Add("sf");
            DropDownList1.Items.Add("nv");
        }

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        DropDownList1.Items.Add(TextBox1.Text);
    }
    protected void Button1_Command(object sender, CommandEventArgs e)
    {

    }
    protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
    {
        switch (DropDownList2.SelectedValue)//要把AUTOPOSTBACK变成true属性
        {
            case "a":
                Label1.Text = "1";
                break;
            case "b":
                Label1.Text = "2";
                break;
            case "c":
                Label1.Text = "3";
                break;
        }
    }
    protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
    {
        if (CheckBox1.Checked)
        {
            Label2.Text = "xuan zhong";
        }
        else
        {
            Label2.Text = "wei xuan zhong";
        }
    }
}

net2:DropDownList的使用

标签:opd   down   add   page   web   box   htm   using   weight   

原文地址:http://www.cnblogs.com/handboy/p/7141613.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!