【问题标题】:Opening and closing braces issue打开和关闭大括号问题
【发布时间】:2019-09-17 18:36:35
【问题描述】:

当我的所有括号都正确关闭时,我无法弄清楚这个错误。

【问题讨论】:

  • 以后请复制粘贴文本,不要使用截图。我必须输入你必须复制的内容。

标签: .net select razor umbraco renderpartial


【解决方案1】:

这里有一些问题:

  1. 你已经在一个代码块中,所以你不需要使用@:

  2. 您需要在 { } 上加倍,因为您正在初始化一个对象 (ViewDataDictionary),它是更多对象 (KeyValuePair<string, object>) 的集合。

  3. RenderPartial 不返回字符串。请改用@Html.Partial

<select id="multiselect" name="Checkbox"
     onChange="@Html.Partial("GalleryListing", new ViewDataDictionary(this.ViewData) { { "param1", this.Value } })">

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-11-13
    • 2012-01-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多