UserControls and Collections Property

Discussion in 'ASP .Net Web Controls' started by CMM, Apr 6, 2006.

  1. CMM

    CMM Guest

    With a Web *UserControl* (not composite control) how do you make a
    collection--
    either custom col derived from CollectionBase or a .NET 2.0 generic List(Of
    MyClass)--- accessible as a property? MyClass is a simple class with just a
    couple of String properties.

    I've tried decorating the property with
    <DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
    _
    PersistenceMode(PersistenceMode.InnerProperty), _
    NotifyParentProperty(True)> _
    Public ReadOnly Property MyItems() As MyClassCollection
    ...

    But it won't work (the first attribute is enough to make any custom
    collection editable via the PropertyEditor in WinForms.... why not
    ASP.NET?).


    --
    -C. Moya
    www.cmoya.com
     
    CMM, Apr 6, 2006
    #1
    1. Advertising

  2. If what you are looking for is getting designtime access to your collection
    in the property editor as you were able to with a winforms user control,
    then i'm afraid this is not possible. Web User Controls have minimal support
    for use in a designer. You might have to go the composite or Custom control
    route if that is a requirement for you.
    http://msdn.microsoft.com/library/d...e/html/cpconcompositecontrolvsusercontrol.asp

    Have a good easter.
    Alessandro Zifiglio
    "CMM" <> ha scritto nel messaggio
    news:...
    > With a Web *UserControl* (not composite control) how do you make a
    > collection--
    > either custom col derived from CollectionBase or a .NET 2.0 generic
    > List(Of
    > MyClass)--- accessible as a property? MyClass is a simple class with just
    > a
    > couple of String properties.
    >
    > I've tried decorating the property with
    >
    > <DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
    > _
    > PersistenceMode(PersistenceMode.InnerProperty), _
    > NotifyParentProperty(True)> _
    > Public ReadOnly Property MyItems() As MyClassCollection
    > ...
    >
    > But it won't work (the first attribute is enough to make any custom
    > collection editable via the PropertyEditor in WinForms.... why not
    > ASP.NET?).
    >
    >
    > --
    > -C. Moya
    > www.cmoya.com
    >
     
    Alessandro Zifiglio, Apr 15, 2006
    #2
    1. Advertising

  3. CMM

    CMM Guest

    Nah. The control is way too complicated... consisting of several Controls
    and a bunch of layout using tables and such... bla bla.... even JavaScript
    is involved. I tried the CompositeControl... got really far (after a
    week).... my CreateChildControls was beautiful and I was quite proud... and
    then ran into some weirdness bubbling up events.

    My toolbar is FULLY functional as just code in a page.... so...
    I was disgusted and made a concious "Economic" decision... it would be far
    more versatile to simply copy and paste my ASP markup and code-behind
    code.... or use a UserControl and simply set the properties in the parent
    Page's code-behind rather than use the PropertyEditor.

    It shouldn't be like pulling teeth to get this stuff to work.

    BTW:
    The WebApplication I'm working on displays a "Toolbar" at the top all of its
    different pages... it consists of:
    1) A Tab control (I created as CompositeControl consisting of just pretty
    cells in a table)
    2) An ASP.NET 2.0 "Menu" bar.
    3) Bunch of layout to achieve a certain look
    4) Scripts (emitted for IE only) that turn the entire toolbar into
    "Stay-in-view div."
    5) The items of the Tab and Menu controls are different for every page...
    but the layout and look and feel is the same (using CSS).

    Say what you will about how "cool" some things are.... but for the most part
    ASP.NET 2.0 does not reflect 3 or 4 years of advancement.... especially when
    you consider the size of Microsoft and their development teams.

    --
    -C. Moya
    www.cmoya.com
    "Alessandro Zifiglio" <AlessandroZifiglio @ -h-o-t-m-a-i-l-c-o-m> wrote in
    message news:...
    > If what you are looking for is getting designtime access to your
    > collection in the property editor as you were able to with a winforms user
    > control, then i'm afraid this is not possible. Web User Controls have
    > minimal support for use in a designer. You might have to go the composite
    > or Custom control route if that is a requirement for you.
    > http://msdn.microsoft.com/library/d...e/html/cpconcompositecontrolvsusercontrol.asp
    >
    > Have a good easter.
    > Alessandro Zifiglio
    > "CMM" <> ha scritto nel messaggio
    > news:...
    >> With a Web *UserControl* (not composite control) how do you make a
    >> collection--
    >> either custom col derived from CollectionBase or a .NET 2.0 generic
    >> List(Of
    >> MyClass)--- accessible as a property? MyClass is a simple class with just
    >> a
    >> couple of String properties.
    >>
    >> I've tried decorating the property with
    >>
    >> <DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
    >> _
    >> PersistenceMode(PersistenceMode.InnerProperty), _
    >> NotifyParentProperty(True)> _
    >> Public ReadOnly Property MyItems() As MyClassCollection
    >> ...
    >>
    >> But it won't work (the first attribute is enough to make any custom
    >> collection editable via the PropertyEditor in WinForms.... why not
    >> ASP.NET?).
    >>
    >>
    >> --
    >> -C. Moya
    >> www.cmoya.com
    >>

    >
    >
     
    CMM, Apr 15, 2006
    #3
  4. As far as Rapid application development and proper IDE support, there is no
    platform or Tool available today that is better than or equal to what you
    are currently getting from microsoft (that i know of) and tbh, I have tested
    many development tools/frameworks on different platforms and had to settle
    for micrsofts .NET framework/ IDE on Windows. From what i have seen during
    my research, microsoft has the better of it and are light years ahead from
    the competition. Even java recently has started to copy .NETs IDE(java
    studio creator) and the web controls model that you are complaining about in
    ..NET as JSF(java server faces) components and tbh, they are very behind in
    this regard.

    Anyway, I dont want to spoil the day for everybody with my rant =P
    I'll add that I understand your frustration and I'll agree that custom web
    controls or composite controls even, can seem a bit complicated to implement
    in comparision to user controls or the current setup you have settled for.
    If you are unable to benefit from the time/effort you must put in the
    development of custom/composite controls and find resonable justification
    for the high cost and this seems to be your case, then i think your current
    setup is just fine.

    If you have some problems in particular with custom/composite web controls
    then feel free to post some code or explain the problem and If i can help i
    will be happy to give you a hand.

    Alessandro Zifiglio
    "CMM" <> ha scritto nel messaggio
    news:et%...
    > Nah. The control is way too complicated... consisting of several Controls
    > and a bunch of layout using tables and such... bla bla.... even JavaScript
    > is involved. I tried the CompositeControl... got really far (after a
    > week).... my CreateChildControls was beautiful and I was quite proud...
    > and then ran into some weirdness bubbling up events.
    >
    > My toolbar is FULLY functional as just code in a page.... so...
    > I was disgusted and made a concious "Economic" decision... it would be far
    > more versatile to simply copy and paste my ASP markup and code-behind
    > code.... or use a UserControl and simply set the properties in the parent
    > Page's code-behind rather than use the PropertyEditor.
    >
    > It shouldn't be like pulling teeth to get this stuff to work.
    >
    > BTW:
    > The WebApplication I'm working on displays a "Toolbar" at the top all of
    > its different pages... it consists of:
    > 1) A Tab control (I created as CompositeControl consisting of just pretty
    > cells in a table)
    > 2) An ASP.NET 2.0 "Menu" bar.
    > 3) Bunch of layout to achieve a certain look
    > 4) Scripts (emitted for IE only) that turn the entire toolbar into
    > "Stay-in-view div."
    > 5) The items of the Tab and Menu controls are different for every page...
    > but the layout and look and feel is the same (using CSS).
    >
    > Say what you will about how "cool" some things are.... but for the most
    > part ASP.NET 2.0 does not reflect 3 or 4 years of advancement....
    > especially when you consider the size of Microsoft and their development
    > teams.
    >
    > --
    > -C. Moya
    > www.cmoya.com
    > "Alessandro Zifiglio" <AlessandroZifiglio @ -h-o-t-m-a-i-l-c-o-m> wrote in
    > message news:...
    >> If what you are looking for is getting designtime access to your
    >> collection in the property editor as you were able to with a winforms
    >> user control, then i'm afraid this is not possible. Web User Controls
    >> have minimal support for use in a designer. You might have to go the
    >> composite or Custom control route if that is a requirement for you.
    >> http://msdn.microsoft.com/library/d...e/html/cpconcompositecontrolvsusercontrol.asp
    >>
    >> Have a good easter.
    >> Alessandro Zifiglio
    >> "CMM" <> ha scritto nel messaggio
    >> news:...
    >>> With a Web *UserControl* (not composite control) how do you make a
    >>> collection--
    >>> either custom col derived from CollectionBase or a .NET 2.0 generic
    >>> List(Of
    >>> MyClass)--- accessible as a property? MyClass is a simple class with
    >>> just a
    >>> couple of String properties.
    >>>
    >>> I've tried decorating the property with
    >>>
    >>> <DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
    >>> _
    >>> PersistenceMode(PersistenceMode.InnerProperty), _
    >>> NotifyParentProperty(True)> _
    >>> Public ReadOnly Property MyItems() As MyClassCollection
    >>> ...
    >>>
    >>> But it won't work (the first attribute is enough to make any custom
    >>> collection editable via the PropertyEditor in WinForms.... why not
    >>> ASP.NET?).
    >>>
    >>>
    >>> --
    >>> -C. Moya
    >>> www.cmoya.com
    >>>

    >>
    >>

    >
    >
     
    Alessandro Zifiglio, Apr 15, 2006
    #4
  5. CMM

    CMM Guest

    I'm comparing ASP.NET to ASP.NET... not to anything else. Everybody knows
    it's the best out there. That it isn't all that much improved since 1.1 was
    my point.

    That we have all gotten used to it and feel a need to defend it is also
    besides the point.

    --
    -C. Moya
    www.cmoya.com
     
    CMM, Apr 15, 2006
    #5
  6. If you are unable to see the huge differences, then I can only add that your
    frustration has gotten the better of you. I dont feel a need to defend
    microsoft, .net 1.1/2.0 or anybody else for that matter, and I invite you
    again to explain what kind of problems you are having with composite
    controls and how anybody can help you here. I'll admit that the discussion
    is taking a wrong curve and is going beyond the scope of this news group.
    Have a good weekend =P
    Alessandro Zifiglio
    "CMM" <> ha scritto nel messaggio
    news:%...
    > I'm comparing ASP.NET to ASP.NET... not to anything else. Everybody knows
    > it's the best out there. That it isn't all that much improved since 1.1
    > was my point.
    >
    > That we have all gotten used to it and feel a need to defend it is also
    > besides the point.
    >
    > --
    > -C. Moya
    > www.cmoya.com
    >
     
    Alessandro Zifiglio, Apr 16, 2006
    #6
    1. Advertising

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. Andreas Klemt
    Replies:
    0
    Views:
    401
    Andreas Klemt
    Jul 8, 2003
  2. CMM
    Replies:
    0
    Views:
    364
  3. Doug Poland
    Replies:
    9
    Views:
    765
    VisionSet
    Sep 27, 2003
  4. mutex
    Replies:
    0
    Views:
    231
    mutex
    Jul 27, 2003
  5. CMM

    UserControls and Collections Property

    CMM, Apr 6, 2006, in forum: ASP .Net Building Controls
    Replies:
    5
    Views:
    144
    Alessandro Zifiglio
    Apr 16, 2006
Loading...

Share This Page