如何获取datalist里面子控件(如:dropdownlist)的值[WEB学习示例]

protected void DataList1_ItemCommand(object source, DataListCommandEventArgs e)//信息显示编辑与删除
    {
        pages = Request["page"];
        LinkButton LBut2 = (LinkButton)DataList1.Items[0].FindControl("LinkButton2");
        LinkButton LBut3 = (LinkButton)DataList1.Items[0].FindControl("LinkButton3");
        if (Session["UserName"] != null)
        {
            if (e.CommandName == "BianJi_getID")
            {
                if (LBut2 != null) { strID = Convert.ToInt16(e.CommandArgument.ToString()).ToString(); }
                if (TextBox9.Text != "") { Session["BaoChi"] = TextBox9.Text; }
                Response.Redirect("Gong_Dan_List.aspx?id=" + strID + "&page=" + pages + "");
            }

            if (e.CommandName == "ShuanChu_getID")
            {
                if (LBut3 != null) { strID = Convert.ToInt16(e.CommandArgument.ToString()).ToString(); }
                ShuanChu_JiLu();
            }
        }
        else
        { Response.Redirect("../default.aspx"); }
    }

 

 

CheckBox chk = (CheckBox)DataList1.Items[0].FindControl("CheckBox1");

 

Control shousuoKJ = (Control)Master.FindControl("ContentPlaceHolder1");
        for (int Bi = 1; Bi <= 3; Bi++)
        { Button Bton = (Button)shousuoKJ.FindControl("Button" + Bi.ToString()); if (Bton != null) { Bton.Enabled = false; } }

 

LinkButton LBut3 = (LinkButton)Controls.Count[0].FindControl("LinkButton3");

----------------------------------------------------------------------------

                                                                    CommandArgument='<%# DataBinder.Eval(Container.DataItem, "id")%>'
                                                                    CommandName="GuanLi_getID" Enabled="False" ToolTip="网站管理。">删除

你可能感兴趣的:(web,textbox,button,null,session,bi)