title: Any Way To get The selected Indices only in CheckBoxList?
body: <p>I want to get the selected Indices or Items only in checkBox lsit instead of iterating through each item as Like is there in ListBox.</p>
  
  <p>I am Getting Selected Value In tWo case In this way:</p>
  
  <pre><code>using System;
  using System.Collections;
  using System.Configuration;
  using System.Data;
  using System.Linq;
  using System.Web;
  using System.Web.Security;
  using System.Web.UI;
  using System.Web.UI.HtmlControls;
  using System.Web.UI.WebControls;
  using System.Web.UI.WebControls.WebParts;
  using System.Xml.Linq;
  
  public partial class ChkBxList_2 : System.Web.UI.Page
  {
      protected void Page_Load(object sender, EventArgs e)
      {
  
      }
      protected void Button1_Click(object sender, EventArgs e)
      {
  
          string li = "";
          foreach(ListItem lt in CheckBoxList1.Items)
          {
              if(lt.Selected)
              li += lt.Text;
  
          }
          Response.Write(li);
  
  
      }
      protected void Button2_Click(object sender, EventArgs e)
      {
  
          string li = "";
          foreach (int lt in ListBox1.GetSelectedIndices())
          {
            li += ListBox1.Items[lt].Text;
  
          }
          Response.Write(li);
  
  
      }
  }
  </code></pre>
  
  <p>In ListBox we have the Option To get Seected Only Items is there any For Check Box List?</p>