Apparently, this extension helper is no longer included in the current MVC Futures.
In my case, I replaced the function call Html.Serialize by MvcSerializer.Serialize method which is included in Microsoft.Web.Mvc namespace.
To serialize any object in a hidden field:
@Html.Hidden("otherComplexData", new Microsoft.Web.Mvc.MvcSerializer().Serialize(complexObject))
Later, the controller can turn back the initial object:
[HttpPost]
public ActionResult Index(
IndexViewModel model,
[Deserialize] DataType otherComplexData
)
I hope you find it useful.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…