谁能告诉我下面网址中提到的 Html.Serialize 函数发生了什么。
当我尝试在 Visual Studio 2010 中的 MVC2 Web 应用程序中使用它时,它无法被识别。
http://weblogs.asp.net/shijuvarghese/archive/2010/03/06/persisting-model-state-in- asp-net-mvc-using-html-serialize.aspx
编辑 - 我正在使用 Visual Studio 2010,当我尝试在视图或部分视图上使用 Html.serialize 时,它带有“内置”mvc2出现在智能感知中。我是否缺少参考资料或其他内容?
Can anyone tell me what happened to the Html.Serialize function mentioned in the url below.
It's not recognized when I try and use it in a MVC2 web app within Visual Studio 2010.
http://weblogs.asp.net/shijuvarghese/archive/2010/03/06/persisting-model-state-in-asp-net-mvc-using-html-serialize.aspx
EDIT - I'm using visual studio 2010 which comes with mvc2 'built in' when i try and use Html.serialize on a view or partial view it's not appearing in intellisense. Am i missing a reference or something?
发布评论
评论(3)
它没有去任何地方。无论您在哪里能够使用 html 扩展,它就在那里。例如,视图、部分视图。
例如:
您是否尝试在控制器中使用它?要按照您引用的文章中所示的方式使用它,您需要在视图中使用它。
你看,我们真的不知道,因为你没有给我们任何可以处理的细节。向我们展示一些代码,我们将移动您的地球。好吧,无论如何尝试一下。
我发现您是新人,所以在提问时,请尝试提供尽可能详细的信息。您可以编辑您的帖子,只需标记您所做的事情即可。我们获得的背景信息越多,我们能提供的帮助就越多。
It hasn't gone anywhere. It is right there, wherever you are able to use the html extensions. Eg, Views, PartialViews.
For example:
Are you trying to use it in a controller? To use it as shown in the article you quote, you need to use it in a view.
You see, we really don't know because you haven't given us any detail to work with. Show us some code, and we will move your earth. Well, try to anyway.
I see you are new, so when asking questions, try to give as much detail as possible. You can edit your post, just mark out what you have done. The more context we get, the more we can help.
我知道为什么了!我也有类似的问题。
您需要下载 ASP.NET 2 Futures 并使用那里提供的 DLL而不是通常的 Mvc DLL。
它在
SerializationExtensions
类中实现。I found out why! I was having similar problems too.
You need to download ASP.NET 2 Futures and use the DLLs provided there instead of the usual Mvc DLL.
It is implemented in
SerializationExtensions
class.它位于 MVCFutures 程序集中,而不是开箱即用的 MVC 框架的一部分。您需要通过 nuget 或手动下载添加包,然后将 using/imports 语句添加到 Microsoft.Web.Mvc,然后才能在视图中使用它。
It's in the MVCFutures assembly and not part of the out the box MVC framework. You will need to add the package via nuget or manual download and then add a using/imports statement to Microsoft.Web.Mvc before you can use it in your view.