November 16th, 2003, 05:56 PM
Setting a non-string property in a user control
I'm trying to make a user control based on a dropdownlist. I want to be able to set the source for the control in my aspx page like this
CreateTimesList is just a function that returns an ArrayList
<Prefix:Test DataSource="<%# CreateTimesList(0,48, true) %>" id=Test1 runat="server" />
<asp:dropdownlist DataSource="<%# CreateTimesList(0,48, true) %>" id=Test1 runat="server" />
I'm using the following code to get and set properties
I can set the CustomProp fine and get the custompropsetmessage when i load the page.
Property DataSource() As Object
_DataSource = value
ddl.DataSource = _DataSource
Property CustomProp() As String
_CustomProp = value
When i try set the datasource however the set method never gets called. Is there some rule saying I can't have an Object as a property or something??
Has anyone got any ideas?