title: Deserialize Html.Serialize intro ViewModel
body: <p>I have View Model with inner ViewModel Address propery.</p>
  
  <pre><code>public class CommonViewModel{
  
  public AddressViewModel PreviouslyAddress { get; set; }
  
  }
  </code></pre>
  
  <p>And Address:</p>
  
  <pre><code> [Serializable]
      public class AddressViewModel 
      {
          public string Address1 { get; set; }
  
          public string Address2 { get; set; }
  
          public string City { get; set; }
  
          public string Prefix { get; set; }
  
          public string ZipCode { get; set; }
  }
  </code></pre>
  
  <p>I want to serialize it, and get deseriliazed on POST. </p>
  
  <p>I use:</p>
  
  <pre><code>@Html.Serialize("PreviouslyAddress", Model.PreviouslyAddress)
  </code></pre>
  
  <p>But in all examples they use Attribute <code>DeserializeAttribute</code> which can be implemented only in method parameters. </p>
  
  <p>Example <a href="http://weblogs.asp.net/shijuvarghese/archive/2010/03/06/persisting-model-state-in-asp-net-mvc-using-html-serialize.aspx" rel="nofollow">enter link description here</a></p>
  
  <p>EDITED</p>
  
  <p>How can I do it without create custom bunding and send part of my model as parameter. </p>
  
  <pre><code>    [HttpPost]              
  public ActionResult Register([DeserializeAttribute] AddressViewModel user, FormCollection userForm)
  {
      TryUpdateModel(user, userForm.ToValueProvider());
  </code></pre>
  
  <p>For example, if it is possible I want something like this:</p>
  
  <pre><code>[HttpPost]              
  public ActionResult Register(CommonViewModel model)
  {
      TryUpdateModel(user, userForm.ToValueProvider());
  
   public class CommonViewModel{
  
          [DeserializeAttribute]
          public AddressViewModel PreviouslyAddress { get; set; }
  
          }
  </code></pre>