title: Loop Through GridView Checkboxes
body: <p>I am trying to loop through all the checkboxes and get their Value and if they are checked or not and save the checked/unchecked into database based on the Value which is going to contains the ID of the record. I am trying to do this through asp.net any suggestions? </p>
  
  <p>Here is the code: </p>
  
  <pre><code>            &lt;Columns&gt;
                  &lt;asp:TemplateField HeaderText="Application" ItemStyle-Width="25%"&gt;
                      &lt;ItemTemplate&gt;                        
                          &lt;%#Eval("App")%&gt;
                      &lt;/ItemTemplate&gt;                    
                  &lt;/asp:TemplateField&gt;
                  &lt;asp:TemplateField HeaderText="Edit" ItemStyle-Width="25%"&gt;
                      &lt;ItemTemplate&gt;
                          &lt;input name="chkEdit" runat="server" value='&lt;%# Eval("AppID") %&gt;' class="checkbox" type="checkbox" checked='&lt;%# Eval("Edit") %&gt;' /&gt;
                      &lt;/ItemTemplate&gt;
                  &lt;/asp:TemplateField&gt;
                  &lt;asp:TemplateField HeaderText="Delete" ItemStyle-Width="25%"&gt;
                      &lt;ItemTemplate&gt;                        
                          &lt;input name="chkDelete" runat="server" value='&lt;%# Eval("AppID") %&gt;' class="checkbox" type="checkbox" checked='&lt;%# Eval("Delete") %&gt;' /&gt;
                      &lt;/ItemTemplate&gt;
                  &lt;/asp:TemplateField&gt;
                  &lt;asp:TemplateField HeaderText="View" ItemStyle-Width="25%"&gt;
                      &lt;ItemTemplate&gt;                        
                          &lt;input name="chkView" runat="server" value='&lt;%# Eval("AppID") %&gt;' class="checkbox" type="checkbox" checked='&lt;%# Eval("View") %&gt;' /&gt;
                      &lt;/ItemTemplate&gt;
                  &lt;/asp:TemplateField&gt;
              &lt;/Columns&gt;  
  </code></pre>