protected void FillDeptDropdownList()
    {
        BLItem objBL = new BLItem();

        DataTable dt = objBL.get_available_courses(int.Parse(Session["New"].ToString()), 3);

        dd.DataSource     = dt;
        dd.DataTextField  = "courseName";
        dd.DataValueField = "courseID";
        dd.DataBind();
        dd.Items.Insert(0, new ListItem("Select Course", "-1"));
    }
Esempio n. 2
0
    protected void FillDeptDropdownList()
    {
        BLItem objBL = new BLItem();

        DataTable dt  = objBL.get_available_courses(int.Parse(Session["New"].ToString()), 3);
        DataTable dt1 = objBL.get_available_courses(int.Parse(Session["New"].ToString()), 1);

        DropDownList0.DataSource     = dt;
        DropDownList0.DataTextField  = "courseName";
        DropDownList0.DataValueField = "courseID";
        DropDownList0.DataBind();
        //DropDownList0.Items.Insert(0, "Select Course");
        DropDownList0.Items.Insert(0, new ListItem("Select Course", "-1"));

        DropDownList1.DataSource     = dt;
        DropDownList1.DataTextField  = "courseName";
        DropDownList1.DataValueField = "courseID";
        DropDownList1.DataBind();
        //DropDownList1.Items.Insert(0, "Select Course");
        DropDownList1.Items.Insert(0, new ListItem("Select Course", "-1"));

        DropDownList2.DataSource     = dt;
        DropDownList2.DataTextField  = "courseName";
        DropDownList2.DataValueField = "courseID";
        DropDownList2.DataBind();
        //DropDownList2.Items.Insert(0, "Select Course");
        DropDownList2.Items.Insert(0, new ListItem("Select Course", "-1"));

        DropDownList3.DataSource     = dt;
        DropDownList3.DataTextField  = "courseName";
        DropDownList3.DataValueField = "courseID";
        DropDownList3.DataBind();
        //DropDownList3.Items.Insert(0, "Select Course");
        DropDownList3.Items.Insert(0, new ListItem("Select Course", "-1"));

        DropDownList4.DataSource     = dt;
        DropDownList4.DataTextField  = "courseName";
        DropDownList4.DataValueField = "courseID";
        DropDownList4.DataBind();
        //DropDownList4.Items.Insert(0, "Select Course");
        DropDownList4.Items.Insert(0, new ListItem("Select Course", "-1"));

        DropDownList5.DataSource     = dt1;
        DropDownList5.DataTextField  = "courseName";
        DropDownList5.DataValueField = "courseID";
        DropDownList5.DataBind();
        //DropDownList5.Items.Insert(0, "Select Course");
        DropDownList5.Items.Insert(0, new ListItem("Select Course", "-1"));

        DropDownList6.DataSource     = dt1;
        DropDownList6.DataTextField  = "courseName";
        DropDownList6.DataValueField = "courseID";
        DropDownList6.DataBind();
        //DropDownList6.Items.Insert(0, "Select Course");
        DropDownList6.Items.Insert(0, new ListItem("Select Course", "-1"));

        DropDownList7.DataSource     = dt1;
        DropDownList7.DataTextField  = "courseName";
        DropDownList7.DataValueField = "courseID";
        DropDownList7.DataBind();
        //DropDownList7.Items.Insert(0, "Select Course");
        DropDownList7.Items.Insert(0, new ListItem("Select Course", "-1"));

        DropDownList8.DataSource     = dt1;
        DropDownList8.DataTextField  = "courseName";
        DropDownList8.DataValueField = "courseID";
        DropDownList8.DataBind();
        //DropDownList8.Items.Insert(0, "Select Course");
        DropDownList8.Items.Insert(0, new ListItem("Select Course", "-1"));

        DropDownList9.DataSource     = dt1;
        DropDownList9.DataTextField  = "courseName";
        DropDownList9.DataValueField = "courseID";
        DropDownList9.DataBind();
        //DropDownList9.Items.Insert(0, "Select Course");
        DropDownList9.Items.Insert(0, new ListItem("Select Course", "-1"));
    }