title: Binding the Model variable to an Action Method in ASP.NET MVC3
body: <p>I have a controller <code>HomeController</code> with the following <code>action method</code>:</p>
  
  <pre><code>[HttpPost] 
  public ActionResult DisplayData(MyViewModel myViewModel)
  {
     // Do something with myViewModel           
  }
  </code></pre>
  
  <p>The <code>ViewModel</code>:</p>
  
  <pre><code>public class MyViewModel
  {
      public string Name { get; set; }
      public string Surname { get; set; }
      public bool IsPeriod { get; set; }
  }
  </code></pre>
  
  <p>And the following <code>View</code></p>
  
  <pre><code>@model AppName.ViewModels.MyViewModel
  
  @{ Html.RenderPartial("MyPartialView", Model);  }
  
  &lt;img src="@Url.Action("DisplayData", "Home", new { myViewModel = Model })" alt="Image" /&gt;
  </code></pre>
  
  <p>I use the Url.Action how it is described <a href="http://www.codeproject.com/Tips/198477/Calling-a-MVC-Controller-and-Action-Method-using-H" rel="nofollow">here</a> but what I get in the DisplayData action method is null. In the source code I got:</p>
  
  <pre><code>&lt;img src="/Home/DisplayData?filters=AppName.ViewModels.MyViewModel" alt="Image" /&gt;
  </code></pre>
  
  <p>so it is passing actually the type instead of the values.</p>
  
  <p>The <code>ViewModel</code> instead is correctly passed to the partial view. What am I doing wrong?</p>