protected void ddlDept_SelectedIndexChanged(object sender, EventArgs e) { DropDownList dd = (DropDownList)sender; string CtrlId = dd.ID; int g = Convert.ToInt32(dd.SelectedValue); Control cd = dd.Parent; UserControl uc = (UserControl)cd; DropDownList ddlEmp = (DropDownList)uc.FindControl("ddlEmp"); DropDownList ddlClass = (DropDownList)uc.FindControl("ddlClass"); DropDownList ddlDept = (DropDownList)uc.FindControl("ddlDept"); int acadamic = Convert.ToInt32(Session["AcademicYear"]); int userid = Convert.ToInt32(Session["UserRoleId"]); DataSet ds = _objDal.getclass(Convert.ToInt32(ddlDept.SelectedValue),userid,acadamic); ddlClass.DataSource = ds; ddlClass.DataTextField = "ClassName"; ddlClass.DataValueField = "es_id"; ddlClass.DataBind(); }
Quote:OK i got the solution C# DropDownList ddl = (DropDownList)sender; UserControl uc = (UserControl)ddl.NamingContainer;
DropDownList ddl = (DropDownList)sender; UserControl uc = (UserControl)ddl.NamingContainer;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)