protected void fillCourseDropDown(String programId) { DropDownList2.Items.Clear(); AppDao appDaoObj = new AppDao(); List <AppCourse> courseList = appDaoObj.getCourseList(programId); if (courseList != null) { foreach (AppCourse course in courseList) { ListItem att2 = new ListItem(); att2.Value = course.courseId.ToString(); att2.Text = course.courseName.ToString(); DropDownList2.Items.Add(att2); } } }
protected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack == false) { AppDao cmnDaoObj = new AppDao(); List <ListItem> moduleTypeList = cmnDaoObj.getCodeListByCodeTypeId(1900); removeSuperAdmin(moduleTypeList, 1903); moduleTypeDdl.Items.AddRange(moduleTypeList.ToArray()); List <ListItem> userTypeList = cmnDaoObj.getCodeListByCodeTypeId(2000); removeSuperAdmin(userTypeList, 2003); userTypeDdl.Items.AddRange(userTypeList.ToArray()); AppDao appDaoObj = new AppDao(); List <AppCourse> appCourseList = appDaoObj.getCourseList(); courseDdl.DataSource = appCourseList; courseDdl.DataTextField = "courseName"; courseDdl.DataValueField = "courseId"; courseDdl.DataBind(); } }