Tag:

.ASPX上的自定义用户控件和友好属性项集合(如ListBox和ListItems,但列表)

我一直想知道如何为用户控件执行公共属性,其工作方式类似于.NET native Item的集合属性(例如,ListBox和ListItems): <- Inline item collection… 我一直在网上查看,但没有任何成功。 我认为它必须是我需要添加到属性的任何类型的属性,OR接口应该需要由用户控件inheritance,但是没有关于它的线索,并且一直在考虑它。 我必须在自定义用户控件上工作,但Visual Studio没有将其识别为有效的项集合。 假设我们有这个userControl: public partial class userControls_Blablabla : System.Web.UI.UserControl { public List ConfigItem {get; set; } blablabla…rest logic here… } public class configItem { public string Name {get; set;} public string Url {get; set;} public string Color {get; set;} blablabla…rest logic here… } 应该如何做,能够在Visual Studio的.ASPX编辑器上做类似的事情,并得到Intellisense的识别? 对不起我的英语,我知道这不是很好。 […]