コード例 #1
0
    protected void insert_courses(object sender, EventArgs e)

    {
        BLItem objBL     = new BLItem();
        string courseID  = dd.SelectedValue;
        string teacherID = empID.Text;
        int    temp      = objBL.check_Emp_username(teacherID);

        if (temp == 1)
        {
            submit.Visible  = false;
            Button1.Visible = true;

            DataTable dt = objBL.get_available_sections(courseID);
            dd1.Visible        = true;
            dd1.DataSource     = dt;
            dd1.DataTextField  = "SectionID";
            dd1.DataValueField = "SectionID";
            dd1.DataBind();
            dd1.Items.Insert(0, new ListItem("Select SectionID", "-1"));
        }
        else
        {
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Employee Does Not Exist.')", true);
        }
    }