title: Combining ViewStates in C# OR combining generic lists in C#
body: <p>I have the following two <strong>ViewStates</strong> 1 storing all the start dates and the other storing all the End dates of a particular event:</p>
  
  <pre><code>private List&lt;DateTime&gt; SelectedStartDates
      {
          get
          {
              if (ViewState["SelectedStartDates"] != null)
                  return (List&lt;DateTime&gt;)ViewState["SelectedStartDates"];
  
              return new List&lt;DateTime&gt;();
          }
          set
          {
              ViewState["SelectedStartDates"] = value;
          }
      }
  
      private List&lt;DateTime&gt; SelectedEndDates
      {
          get
          {
              if (ViewState["SelectedEndDates"] != null)
                  return (List&lt;DateTime&gt;)ViewState["SelectedEndDates"];
  
              return new List&lt;DateTime&gt;();
          }
          set
          {
              ViewState["SelectedEndDates"] = value;
          }
      }
  </code></pre>
  
  <p><strong>Question:</strong></p>
  
  <p>Is there a way in which I can have a combined List of values stored in these two ViewStates in the following manner:</p>
  
  <pre><code>List[0] = first value of Start date
  
  List[1] = first value of End date
  
  List[2] = second value of Start date
  
  List[3] = second value of End date
  
  .
  
  .
  
  . 
  </code></pre>
  
  <p>and so on till the last value of both the Lists in the <strong>ViewState</strong>.</p>
  
  <p>The other way I can think of is to combine the <strong>Generic List</strong> returned by the <strong>ViewState</strong> again in a manner as mentioned above.</p>
  
  <p>Also, I would like to keep the duplicate values in the combined list</p>
  
  <p>Is there a work-around for this?</p>