Gridview中二级联动

代码
 protected void drpZuoyedian_SelectedIndexChanged(object sender, EventArgs e)
 {
        DropDownList drpZuoyedian 
= (DropDownList)sender;
        GridViewRow gvData 
= (GridViewRow)drpZuoyedian.NamingContainer;

        
string zuoyedian = drpZuoyedian.SelectedValue;
        DropDownList drpXianbie 
= (DropDownList)gvData.FindControl("drpXianbie");
        
string sqlxianbie = "select * from pubXianbie where parent_id='" + zuoyedian + "'";
        Util.BindDropDownList(drpXianbie, sqlxianbie, 
"name""id");
 }

 

posted on 2010-09-16 15:57  whh  阅读(373)  评论(0编辑  收藏  举报