using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class UserControl_Dept : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
          
    }

    protected void ListBox1_SelectedIndexChanged(object sender, EventArgs e)
    {
        this.AccessDataSource2.SelectParameters[0].DefaultValue = this.ListBox1.SelectedValue;
    }
    protected void ListBox1_DataBound(object sender, EventArgs e)
    {
        this.ListBox1.SelectedIndex = 0;
        this.AccessDataSource2.SelectParameters[0].DefaultValue = this.ListBox1.SelectedValue;
    }
    protected void ListBox2_DataBound(object sender, EventArgs e)
    {
        if (this.ListBox2.Items.Count != 0)
        {
            this.ListBox2.SelectedIndex = 0;
        }
        else
        {
            this.ListBox2.SelectedIndex = -1;
        }
    }
}
