救助:aspx页面A怎么执行ascx用户控件B中的方法
aspx页面A: 这里怎么执行ascx用户控件B中的BindGH(gh)以便绑定用户控件中的GridView1?
ascx用户控件B:
void BindGH(string Gong)
{
string sqlstr = "Select * From LHB_USER_DATA where LHB_Group=4 and LHB_GongHao='" + Gong + "'";
SqlConnection sqlcon = new SqlConnection(connStr);
SqlDataAdapter myda = new SqlDataAdapter(sqlstr, sqlcon);
DataSet myds = new DataSet();
sqlcon.Open();
myda.Fill(myds);
DataView view = myds.Tables[0].DefaultView;
GridView1.DataSource = view;
GridView1.DataBind();
sqlcon.Close();
}