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

Discussion in 'ASP .Net' started by Henri, May 17, 2004.

  1. Henri

    Henri Guest

    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
     
    Henri, May 17, 2004
    #1
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. john
    Replies:
    2
    Views:
    7,532
  2. Earl Teigrob
    Replies:
    4
    Views:
    610
    Earl Teigrob
    May 19, 2004
  3. Jonah Olsson
    Replies:
    1
    Views:
    744
    Scott Allen
    Apr 5, 2005
  4. Replies:
    7
    Views:
    910
    Victor Bazarov
    May 9, 2005
  5. Lee Harr
    Replies:
    1
    Views:
    317
    Lee Harr
    May 8, 2004
  6. Daniel Pitts
    Replies:
    7
    Views:
    708
  7. Jeremy Chapman

    Custom control with complex property type (System.Web.UI.Control[])

    Jeremy Chapman, Feb 15, 2006, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    258
    Jeremy Chapman
    Feb 15, 2006
  8. Jonah Olsson
    Replies:
    2
    Views:
    357
    Jonah Olsson
    Apr 5, 2005
Loading...