How to serialize an object in MVC 5 Razor view
<p>I have tried to follow <a href="https://stackoverflow.com/questions/6402628/multi-step-registration-process-issues-in-asp-net-mvc-splitted-viewmodels-sing">this</a> post in order to create a 3 page form wizard that passes data to each page.</p>

<p>He uses the HTML helper <code>serialize</code>, to serialize an object in the view.</p>

<pre><code>@Html.Serialize("wizard", Model)
</code></pre>

<p>However this HTML helper isn't available in MVC 5 it seems.</p>

<p>I found another related post to this <a href="https://stackoverflow.com/questions/25828553/cannot-find-html-serialize-helper-in-mvc-5-futures">here</a> where he suggests using the following to serialize the object.</p>

<pre><code>@Html.Hidden("otherComplexData", new Microsoft.Web.Mvc.MvcSerializer().Serialize(complexObject))
</code></pre>

<p>But I then get the following error</p>

<p><code>There is no argument given that corresponds to the required formal parameter 'mode' of 'MvcSerializer.Serialize(object, SerializationMode)'</code></p>

<p>It seems to want a SerializationMode, however the documented one doesn't. <a href="https://msdn.microsoft.com/en-us/library/microsoft.web.mvc.mvcserializer.serialize(v=vs.118).aspx" rel="nofollow noreferrer">https://msdn.microsoft.com/en-us/library/microsoft.web.mvc.mvcserializer.serialize(v=vs.118).aspx</a></p>

<p>What direction can I go in now?</p>

<p>Thanks.</p>