protected void gdv_Menu_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes.Add("onclick", "RowClick(this);"); //获取父菜单名称 Label parentMenuName = (Label)e.Row.FindControl("lblParent"); parentMenuName.Text = menuBll.GetMenuNameByID(gdv_Menu.DataKeys[e.Row.RowIndex].Values[1].ToString()); } }