【发布时间】:2015-04-19 20:52:13
【问题描述】:
我在运行时绑定的asp.net 页面上有一个Repeater 控件。 asp.net 中继器控件的项目模板内有一个下拉列表。
我想知道是否可以在设计时添加列表项。我可以在运行时绑定下拉菜单,但不确定是否可以在设计时进行。
这是我迄今为止尝试过的,但没有运气;
<asp:DropDownList ID="ddlContact" runat="server">
<asp:ListItem Text="select" Value="0" Selected="True" ></asp:ListItem>
<asp:ListItem Text="phone" Value='<%#DataBinder.Eval(Container.DataItem, "InspectorID").ToString() + "|phone" %>' ></asp:ListItem>
<asp:ListItem Text="email" Value='<%#DataBinder.Eval(Container.DataItem, "InspectorID").ToString() + "|email" %>' ></asp:ListItem>
</asp:DropDownList>
【问题讨论】: