我有List<Something>
类型的属性的用户控件:ASP.NET:自定义控件(或用户控件),属性为List <Something>。该属性可以在ASPX源代码中设置吗?
Private p_myList As New List(Of Guid)
Public Property MyList() As List(Of Guid)
Get
Return p_myList
End Get
Set(ByVal value As List(Of Guid))
If value Is Nothing Then Throw New ArgumentNullException()
p_myList = value
End Set
End Property
是否popssible在使用用户控件的页面的ASPX源设置此属性,例如,像:
<uc1:myUserControl runat="server" MyList="3c7d794e-7645-46e7-bdde-a0bc42679261, 3c7d794e-7645-46e7-bdde-a0bc42679262" />
还是我需要创建一个“兼容属性”类型的字符串,然后解析? (我知道我可以通过代码隐藏设置这些值,但我宁愿做在ASPX源。)
http://stackoverflow.com/questions/859625/is-it-possible的可能的复制-to-initialize-a-controls-listt-property-in-markup? – jelbourn 2010-10-20 14:03:12