title: pass Dictionary<string, List<string>> from View to Controller in MVC
body: <p>I want to pass some data from my view to my controller, my view looks like this:</p>
  
  <pre><code>  &lt;div id="Section1" class="divFiles"&gt;
      &lt;span&gt;Section 1 &lt;/span&gt;
  
  &lt;input type="text" name="test[0]"&gt;
  
  &lt;input type="text" name="test[1]"&gt;
  
  &lt;input type="text" name="test[2]"&gt;
  
  &lt;input type="text" name="test[3]"&gt;
  
  &lt;/div&gt;
  
    &lt;div id="Section2" class="divFiles"&gt;
      &lt;span&gt;Section 2 &lt;/span&gt;
  
  &lt;input type="text" name="test[4]"&gt;
  
  &lt;input type="text" name="test[5]"&gt;
  
  &lt;input type="text" name="test[6]"&gt;
  
  &lt;input type="text" name="test[7]"&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p>But this way I'm just sending a list of strings to my controller, there are not keys and I need key because I need this to be grouped by keys.</p>
  
  <p>I would like to pass my data like a <code>Dictionary</code>, grouped by sections, for example:</p>
  
  <p><code>Section 1: {"first string", "second string", "third string"},
  Section 2: {"fourth string", "fifth string"}</code></p>
  
  <p>and like that,I'm thinking that the best way to do this probably is sending the data as a <code>Dictionary</code> of type <code>Dictionary&lt;string, List&lt;string&gt;&gt;</code> where <code>Section 1</code>, <code>Section 2</code> would be the <code>keys</code> and then the list of string their <code>values</code>, how could I do that? I can use JQuery for that purpose too, but I'm not sure of how I must write the html to send the data like that. Doing it this way my parameter in my controller action should be of type <code>Dictionary&lt;string, List&lt;string&gt;&gt;</code> Any suggestions of doing this in a different way is welcome too</p>