Пример #1
0
    protected void ddPerson_SelectedIndexChanged(object sender, EventArgs e)
    {
        ComposeDAL sdal = new ComposeDAL();

        if (ddPerson.SelectedValue == "-1")
        {
            ddReciever.Items.Clear();
        }

        else if (ddPerson.SelectedValue == "Admin")
        {
            ddReciever.Items.Clear();
            ddReciever.Enabled = false;
        }
        else if (ddPerson.SelectedValue == "-3")
        {
            int id = Convert.ToInt32(Session["Marks_Key"]);
            ddReciever.DataSource = sdal.GetStudentNameByCourse(id);

            ddReciever.DataTextField  = "Student Name";
            ddReciever.DataValueField = "Student Name";
            ddReciever.DataBind();
        }
        else
        {
            //label error here
        }
    }