title: Save all changes in DataList on button click
body: <p>I have the following DataList-</p>
  
  <pre><code>&lt;td&gt;
  &lt;asp:Label ID="Label3" runat="server" Text="Exclude"&gt;&lt;/asp:Label&gt;
  &lt;asp:DataList runat="server" ID="excludeTextBox"&gt;
  &lt;ItemTemplate&gt;
  
  &lt;br /&gt;
  &lt;asp:TextBox ID="myTextBox" runat="server" Text='&lt;%# Container.DataItem.ToString() %&gt;'&gt;&lt;/asp:TextBox&gt;&amp;nbsp;
  
  
  &lt;/ItemTemplate&gt;
  &lt;/asp:DataList&gt;
  &lt;td&gt;
  &lt;asp:Label ID="Label4" runat="server" Text="Active"&gt;&lt;/asp:Label&gt;
  &lt;asp:DataList runat="server" ID="activeCheck" &gt;
  
  &lt;ItemTemplate&gt;
  
  &lt;br /&gt;
  &lt;asp:CheckBox ID="CheckBox1" runat="server"  Checked='&lt;%# Container.DataItem.ToString().Equals("1") %&gt;' OnCheckedChanged="CheckBox1_CheckedChanged" AutoPostBack="true" /&gt;
  
  
  &lt;/ItemTemplate&gt;
  &lt;/asp:DataList&gt;
  
  &lt;/td&gt;
  </code></pre>
  
  <p>So this is generating a textBox and checkBox for every row that exits in the database. </p>
  
  <p>Currently there is no save action associated with the dataList, however if a user checks or unchecks one of the checkBoxes this calls a webservice and toggles the value in a data base table.</p>
  
  <p>My question is, after a user has edited the text in some of the textBoxes and checked or unchecked some of the check boxes, how can I catch the changes in a <code>save changes</code> button. Because if the items have been dynamically created then technically they do not exist on the page. I want to do this without having a save option on ever row on the dataList.</p>
  
  <pre><code>protected void saveChanges_Click(object sender, EventArgs e)
  {
       // capture all edits and call update webservice method.   
  }
  </code></pre>