net2:DropDownList的使用

2021-06-29 12:05

阅读:532

标签: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


评论


亲,登录后才可以留言!