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

孤人 提交于 2019-12-23 08:37:12

问题


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?


回答1:


Html.Serialize is in the Futures assembly.




回答2:


Install the Nuget package: Install-Package Mvc3Futures.

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




回答3:


Serialize() is not listed here.

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




回答4:


I downloaded the futures, removed reference to its local System.Web.Mvc (v3), and added the release version from GAC, and included the new futures DLL in project.



来源:https://stackoverflow.com/questions/4476736/mvc-3-and-html-serialize-asp-net-4-mvc3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!