TabStrip中的Kendo UI模板语法

问题描述 投票:0回答:1

我有一个包含标签的kendo模板。在这个tabtrip中,我有一个使用kendo模板语法的项目,如下所示:

items.Add().Text("Block Attributes").LoadContentFrom("BlockAttributes", "Properties", new { blockRef = "#=BlockRef#" });

在这种情况下,块ref按预期输出。但是当使用像这样的.Action()方法时:

items.Add().Action("Details", "Properties", new { fiscalYear = Model.FiscalYear, blockRef = "#=BlockRef#" }).Text("Details");

propertyId使用键入的文字字符串,因此它将尝试使用“#= BlockRef#”作为导致错误的参数进行导航。

为什么它适用于前者而不适用于后者?我如何让它工作?

kendo-ui telerik kendo-asp.net-mvc telerik-mvc
1个回答
0
投票

我发现的解决方案尽管可能不明智,但要做到以下几点:

items.Add().Text("Details").Url(Url.Action("Detail", "Properties", new { fiscalYear = Model.FiscalYear, blockRef = -1 }).ToString().Replace("-1", "#=BlockRef#"))

似乎没有办法让Kendo模板直接使用Url.Action(),首先必须生成html,然后必须单独替换参数。我使用-1,因为BlockRef期望一个int,并且没有可能的方法让-1在系统中自然出现。

© www.soinside.com 2019 - 2024. All rights reserved.