title: Send a Complex Object as a Parameter to Post Action in ASP.NET MVC3
body: <p>I try to send a parameter with <code>submit</code> button to post action so there is my sample:</p>
  
  <pre><code>@using(Html.BeginForm(actionName: "Search", controllerName: "MyController", routeValues: new { rv = "102" })) {
  
     ...
    &lt;input type="submit" value="Search" /&gt;
  }
  </code></pre>
  
  <p>And this is My Search Action:</p>
  
  <pre><code>[HttpPost]
  public virtual ActionResult Search(string rv, FormCollection collection) {
  
   ...
  }
  </code></pre>
  
  <p>So Every thing is fine until now, </p>
  
  <p>Then I try to Send a complex object like a <code>Dictionary&lt;string, string&gt;</code></p>
  
  <p>So you can just replace <code>string</code> type of <code>rv</code> parameter with <code>Dictionary&lt;string, string&gt;</code> and send a dictionary, but in this case the <code>rv</code> value always returned a dictionary with 0 count? where is the problem? How can I send a dictionary to post action? </p>
  
  <p><strong>Update</strong></p>
  
  <p>I Also try this one but not worked yet (Mean rv steel is a dictionary with 0 count):</p>
  
  <pre><code>@using(Html.BeginForm(actionName: "Search", controllerName: "MyController", routeValues: new { rv = Model.MyDictionary }, method: FormMethod.Post, htmlAttributes: new { @class = "FilterForm" })) {
  
   ...
  }
  
  [HttpPost]
  public virtual ActionResult Search(Dictionary&lt;string, string&gt; rv, FormCollection collection) {
  
   ...
  }
  </code></pre>