ASP.NET MVC测试版1 - 哪里是Html.RenderPartial? [英] ASP.NET MVC Beta 1 - where is Html.RenderPartial?
问题描述
我只是在5应用程序升级我的preVIEW到Beta 1版本的过程中,我几乎想呈现一个控制时,有保存这一个错误:
I'm just in the process of upgrading my Preview 5 application to Beta 1, and I'm nearly there save for this one error when trying to render a control:
System.Web.Mvc.HtmlHelper'不
包含一个定义
的RenderPartial'没有扩展名
法的RenderPartial接受
类型的第一个参数
System.Web.Mvc.HtmlHelper可能是
(是否缺少using
指令或程序集引用?)
'System.Web.Mvc.HtmlHelper' does not contain a definition for 'RenderPartial' and no extension method 'RenderPartial' accepting a first argument of type 'System.Web.Mvc.HtmlHelper' could be found (are you missing a using directive or an assembly reference?)
我的标记(在.aspx视图内容页)是:
My markup (in the .aspx View Content Page) is:
<% Html.RenderPartial("Controls/UserForm", ViewData); %>
我使用Microsoft.Web.Mvc但无济于事尝试。有谁知道在哪里Html.RenderPartial已经走了,我也可以用什么替代?
I've tried using Microsoft.Web.Mvc but to no avail. Does anyone know where Html.RenderPartial has gone, or what alternative I could use?
推荐答案
和也不要忘记像下面添加命名空间web配置,我想preVIEW 5默认web.config中没有的System.Web .Mvc.Html它:
And also don't forget to add namespaces like below to the web config, I think preview 5 default web.config does not have System.Web.Mvc.Html in it:
<namespaces>
<add namespace="System.Web.Mvc"/>
<add namespace="System.Web.Mvc.Ajax"/>
<add namespace="System.Web.Mvc.Html"/>
<add namespace="System.Web.Routing"/>
<add namespace="System.Linq"/>
<add namespace="System.Collections.Generic"/>
</namespaces>
这篇关于ASP.NET MVC测试版1 - 哪里是Html.RenderPartial?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!