title: How to get values from multiple checked checkboxes in asp.net?
body: <p>I have a set of input checkboxes without name and I would like to get the values from gridview of those that I have only checked, how can I achieve that? I am really struggling to get it done (BtnAdd_Click). Maybe you could help? Below are the .aspx and .aspx.cs codes: </p>
  
  <pre><code>    &lt;asp:GridView ID="GvModules"
          AutoGenerateColumns="False"
          AllowSorting ="True"
          OnSorting="GvModules_Sorting"
          runat="server"
          CssClass="table table-bordered table-striped table-condensed table-hover table-responsive" OnSelectedIndexChanged="GvModules_SelectedIndexChanged"&gt;
          &lt;Columns&gt;
              &lt;asp:BoundField DataField="moduleid" HeaderText="Module ID" /&gt;
              &lt;asp:BoundField DataField="module_name" HeaderText="Module Name" /&gt;
              &lt;asp:BoundField DataField="descriptions" HeaderText="Module Descriptions" /&gt;
              &lt;asp:BoundField DataField="msa_DateTime" HeaderText="Start Date/Time" /&gt;
              &lt;asp:TemplateField HeaderText="Check To Indicate"&gt;
                  &lt;ItemTemplate&gt;
                      &lt;asp:CheckBox ID="ChkAdd"
                          runat="server"
                          Text=""
                          CommandArgument='&lt;%#Eval("moduleid") %&gt;'
                          OnCommand="ChkAdd_Command"
                          OnClientClick='&lt;%# "javascript:return confirm(\"Add [" + Eval("module_name") + "]\");"  %&gt;' /&gt;
                  &lt;/ItemTemplate&gt;
              &lt;/asp:TemplateField&gt;
          &lt;/Columns&gt;
      &lt;/asp:GridView&gt;
  &lt;/div&gt;
  &lt;div class="form-group"&gt;
      &lt;div class="col-sm-offset-3 col-sm-9"&gt;
          &lt;asp:Button ID="BtnAdd" CssClass="btn btn-default" Text="Indicate" OnClick="BtnAdd_Click" runat="server" /&gt;
      &lt;/div&gt;
  
  &lt;/div&gt;
  &lt;div class="row"&gt;
      &lt;hr /&gt;
      &lt;asp:Literal ID="LtlSchool" runat="server" /&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p>This is Button click event:</p>
  
  <pre><code> protected void BtnAdd_Click(object sender, EventArgs e)
              {
  
              }
  </code></pre>