我可以通过在Repeater中访问来访问单行文本字段类型:
<sc:FieldRenderer ID="frTitle" runat="server" 
    FieldName="Title" 
    Item="<%# (Sitecore.Data.Items.Item)Container.DataItem %>" />
但是如何访问项目中定义的下拉列表字段类型选择值.
谢谢
这取决于您使用的确切字段类型.
Droplist字段类型该值以Site text格式存储在Sitecore中,表示所选项目的名称*.在这种情况下,您可以使用代码示例来呈现所选项目的名称(如果这确实是您想要做的).*请注意,内容编辑器将在下拉列表中看到项目的显示名称,但您的代码将呈现项目名称.使用此字段类型通常不是一个好主意,因为无法翻译项目名称.
DropTree或Droplink字段类型值存储在Sitecore中是链接项的ID.在这种情况下,您需要使用此ID获取所选项目,然后呈现该项目的必填字段.我可能会编写一个代码隐藏方法来获取所选项目,然后在FieldRenderer中调用此方法.像这样的东西:
代码隐藏:
public Item GetLinkedItem(Item item, string itemField)
{
    string dropDownItemId = item[itemField];
    return Sitecore.Context.Database.GetItem(dropDownItemId);
}
Ascx标记:
<asp:Repeater ID="rptChildren" runat="server">
    <ItemTemplate>
        <sc:FieldRenderer ID="frTitle" runat="server"
            FieldName="Title"
            Item='<%# GetLinkedItem((Sitecore.Data.Items.Item)Container.DataItem, "YourDropLinkFieldName") %>' />
</ItemTemplate>