title: adding multiple objects to arraylist
body: <p>Hi I have a method where I am passing values checkbox from the view to the controller. Below is the controller method. </p>
  
  <p>However, when I try to checkbox 2 values from the data table both will pass as the value and the list will be splitted correctly but when adding to the arraylist, only the last one to be checkbox is sent in. My first value will be overwritten by the last one but my count will remain the same. </p>
  
  <p>any help will be appreciated and please go easy on me as I am new with this.</p>
  
  <pre><code>public virtual actionresult value(string value)
  {
      var list = value.Split('#');
      if (list != null )
      {
          ArrayList arr = new ArrayList();
          for (int i = 0; i &lt; list.Length; i++)
          {
              foreach (var key in list)
              {
                  if (key == null || string.IsNullOrEmpty(key.Trim()))
                  {
                      continue;
                  }
  
                  var nric = key.Split('|')[0];
                  var dob = key.Split('|')[1];
  
                  s.NRIC = nric;
                  s.DOB = Convert.ToDateTime(dob);
  
                  arr.Add(s);
              }
          }
      }
  }
  </code></pre>