title: how to data bind to dropdownlist when checkbox is checked in asp.net
body: <p>I  have a project that using dropdownlist  for choices.When check  checkbox1  dropdown automatically bind data from database using  table1 and when I check checkbox2 dropdown automatically binding data from database using table2.I do not want to use get data by using any button .How can I do that .Please help me.</p>
  
  <p>here is code by using button:</p>
  
  <pre><code>public  void LokasyonDoldur()
      {
          birimBUS = new BirimBUSV1();
          List&lt;BirimVO&gt; birimVO = new List&lt;BirimVO&gt;();
          DrpChcs.Items.Clear();
          List&lt;ListItem&gt; items = new List&lt;ListItem&gt;();
          birimVO = birimBUS.LokasyonlariGetir();
          foreach (var item in birimVO)
          {
              items.Add(new ListItem(item.BirimAdi, item.ID.ToString()));
          }
          DrpChcs.Items.AddRange(items.ToArray());
      }
      public void BirimleriDoldur()
      {
          PoliklinikBUS poliklinikBUS = new PoliklinikBUS();
          List&lt;PoliklinikVO&gt; poliklinikVO = new List&lt;PoliklinikVO&gt;();
          DrpChcs.Items.Clear();
          List&lt;ListItem&gt; items = new List&lt;ListItem&gt;();
          poliklinikVO = poliklinikBUS.Poliklinikler();
          foreach (var item in poliklinikVO)
          {
              items.Add(new ListItem(item.PoliklinikAdi, item.ID.ToString()));
          }
          DrpChcs.Items.AddRange(items.ToArray());
      }
      protected void BtnLokasyon_Click(object sender, EventArgs e)
      {
          if (ChckLctn.Checked == true &amp;&amp; ChckBrm.Checked==false)
          {
              LokasyonDoldur();
          }
          else if (ChckLctn.Checked == false &amp;&amp; ChckBrm.Checked == true)
          {
              BirimleriDoldur();
          }
          else
          {
  
          }
          Button1.Visible = true;
          BtnLokasyon.Visible = false;
      }
  
      protected void DrpChcs_SelectedIndexChanged(object sender, EventArgs e)
      {
  
      }
  
      protected void Button1_Click(object sender, EventArgs e)
      {
          KirilimId = Int32.Parse(DrpChcs.SelectedValue);
          BPolikilinikID= KirilimId;
      }
  </code></pre>
  
  <p>but I do not want to use this one.</p>