UserControls and Collections Property

C

CMM

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?).
 
A

Alessandro Zifiglio

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
 
C

CMM

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 said:
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
 
A

Alessandro Zifiglio

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 said:
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

CMM

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.
 
A

Alessandro Zifiglio

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
 

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,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top