How to pass other than a primitive type as a property of a custom control?

H

Henri

I would like to do sth like this:

Page:
<MyNS:MyControl runat="server" Id="MyId" List="1,2,5,6" />


Code:
Public Property List As ArrayList
Get
If ViewState("List") Is Nothing Then
Return new ArrayList()
End If
Return CType(ViewState("List"), ArrayList) 'Is This possible?
End Get
Set
ViewState("List") = .... 'What can I do here if I want to parse the
received string to an ArrayList???
End If
End Set
End Property

There are lots of examples of String properties on the Web, but nothing
about Objects...
Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top