title: MVC 3 DropDownListFor: Cannot figure out 'System.Web.Mvc.SelectList' cannot be serialized
body: <p>I cannot figure out how to do serialization with a DropDownList and am getting the error "<strong>Type 'System.Web.Mvc.SelectList' cannot be serialized.</strong>" I am using serialization in a wizard form to persist the user inputs through the end and then to post a confirmation.</p>
  
  <p>I am using the following in a view:</p>
  
  <pre><code>@using (Html.BeginFormAntiForgeryPost())
  { 
      @Html.Hidden("myData", new MvcSerializer().Serialize(Model, SerializationMode.Signed))
      ...
      @Html.DropDownListFor(m =&gt; m.RealEstate, Model.RealEstateList)
      ...
  }
  </code></pre>
  
  <p>In my ViewModel (MyData), I have:</p>
  
  <pre><code>[Serializable]
  public class myData
  {
  public int RealEstate { get; set; }
  public IEnumerable&lt;SelectListItem&gt; RealEstateList { get; set; }
  ...
  public MyData()
      {
          var realestatelist = new List&lt;SelectListItem&gt;() {
              new SelectListItem { Text = "(Please select)" },
              new SelectListItem { Value = "1", Text="Some text." },                
              new SelectListItem { Value = "2", Text="Some other text." }
              };
          this.RealEstateList = new SelectList(realestatelist, "Value", "Text");
      }
  }
  </code></pre>
  
  <p>Any help is greatly appreciated.</p>