【问题标题】:Sending an anonymous type with RenderPartial使用 RenderPartial 发送匿名类型
【发布时间】:2011-02-01 22:11:06
【问题描述】:

我正在尝试使用 RenderPartial 发送匿名类型,但这种方法只允许我 发送 (string, object , viewDataDictionary) or (string) or (string, object)。

我正在使用 MVC 1.0。我在这里有什么遗漏吗?

这是我想要得到的工作:

<% Html.RenderPartial("ProductDisplay", product, new { DisplayAddToCartButton = false }); %>

感谢您的帮助

【问题讨论】:

    标签: model-view-controller html-helper anonymous-types


    【解决方案1】:

    试试:

    <% Html.RenderPartial("ProductDisplay", product, (new ViewDataDictionary { { "DisplayAddToCartButton", false } })); %>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-05-29
      • 1970-01-01
      • 2017-10-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多