1.DropDownList
asp.net页面:
<asp:DropDownList ID="drpTemplateType" runat="server" AutoPostBack="true" onselectedindexchanged="drpTemplateType_SelectedIndexChanged">
</asp:DropDownList>
.cs代码:
drpTemplateType.DataBind(typeof(EnumCMSTemplateType));
2.Repeater
asp.net页面:
<asp:Repeater runat="server" ID="rptStuaus"> <ItemTemplate> <li value=‘<%#Eval("EnumValue") %>‘><a><%#Eval("EnumDisplayText") %></a><> </ItemTemplate> </asp:Repeater>
.cs代码
rptStuaus.DataSource = ALEnumDescription.GetFieldTexts(typeof(CRMRequirementEnum)).Where(d => d.EnumValue != (int)CRMRequirementEnum.HasEded && d.EnumValue != (int)CRMRequirementEnum.HasCompleted); ; rptStuaus.DataBind();
时间: 2024-10-26 02:43:08