Example #1
0
        //All regNo load for Dropdown
        public List <SelectListItem> GetStudentRegNoForDropdown()
        {
            List <SelectListItem> selectListItems = new List <SelectListItem>();

            selectListItems.Add(new SelectListItem()
            {
                Text = "--Select--", Value = ""
            });

            List <Student> getAllStudentRegNo = AStudentResultGateway.GetAllStudentRegNo();


            foreach (Student aStudent in getAllStudentRegNo)
            {
                SelectListItem selectList = new SelectListItem();
                selectList.Text  = aStudent.RegistrationNo;
                selectList.Value = aStudent.StudentId.ToString();
                selectListItems.Add(selectList);
            }
            return(selectListItems);
        }