我在名为 position 的 Umbraco 文档类型中有一个属性numeric
(见下文)。
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
var results = CurrentPage.Children();
}
@foreach(var result in results.OrderBy("position"))
{
@result.position
}
我期待看到1, 2, 3, 4 ... 11, 12...
然而,我实际上看到1, 11, 12, 2, 3, 4...
position 属性在 Umbraco 中设置为数字,但我似乎无法将顺序更改为基于整数而不是基于字符串。
关于我哪里出错的任何想法?