Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MVC-3 and Html.Serialize (ASP.NET 4, MVC3)

Currently working on a project in MVC-3. Trying to put the following code in my view, but Visual Studio is telling me it can't find the Serialize method.

@Html.Serialize("User",Model)

(ex)

@using (Html.BeginForm())
{

 @Html.Serialize("User",Model)
    <fieldset>
...
    </fieldset>
}

Is this feature missing in MVC-3? I see examples of people using it in MVC-2. Perhaps there is a new way of handling this issue?

like image 692
Rob Avatar asked Dec 18 '10 05:12

Rob


3 Answers

Html.Serialize is in the Futures assembly.

like image 94
Mauricio Scheffer Avatar answered Nov 11 '22 16:11

Mauricio Scheffer


Install the Nuget package: Install-Package Mvc3Futures.

On your view, add a reference to namespace Microsoft.Web.Mvc, then you can use Html.Serialize.

like image 6
Ricardo Peres Avatar answered Nov 11 '22 17:11

Ricardo Peres


Serialize() is not listed here.

It is not a part of Sys.Web.Mvc, but is for now part of Microsoft.Web.Mvc:

like image 2
Hobbes Avatar answered Nov 11 '22 15:11

Hobbes