コード例 #1
0
        protected void DDSourceType_SelectedIndexChanged(object sender, EventArgs e)
        {
            DDSourceID.Items.Clear();
            var ds = new DataSet();

            switch (DDSourceType.SelectedValue)
            {
            case "3":       // game
                ds = Minigame.GetAll();
                DDSourceID.DataTextField  = "AdminName";
                DDSourceID.DataValueField = "MGID";
                DDSourceID.DataSource     = ds;
                DDSourceID.DataBind();
                DDSourceID.SelectedValue = DDSourceID.Items[0].Value;
                break;

            case "4":       // booklist
                ds = BookList.GetAll();
                DDSourceID.DataTextField  = "AdminName";
                DDSourceID.DataValueField = "BLID";
                DDSourceID.DataSource     = ds;
                DDSourceID.DataBind();
                DDSourceID.SelectedValue = DDSourceID.Items[0].Value;
                break;

            case "5":       // event
                ds = Event.GetAll();
                DDSourceID.DataTextField  = "EventTitle";
                DDSourceID.DataValueField = "EID";
                DDSourceID.DataSource     = ds;
                DDSourceID.DataBind();
                DDSourceID.SelectedValue = DDSourceID.Items[0].Value;
                break;

            case "0":
            default:
                break;
            }
        }