Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Building Controls / April 2006

Tip: Looking for answers? Try searching our database.

UserControls and Collections Property

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
CMM - 06 Apr 2006 23:32 GMT
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?).

Signature

-C. Moya
www.cmoya.com

Alessandro Zifiglio - 15 Apr 2006 09:52 GMT
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/default.asp?url=/library/en-us/cpguide/html/cp
concompositecontrolvsusercontrol.asp


Have a good easter.
Alessandro Zifiglio
> With a Web *UserControl* (not composite control) how do you make a
> collection--
[quoted text clipped - 16 lines]
> collection editable via the PropertyEditor in WinForms.... why not
> ASP.NET?).
CMM - 15 Apr 2006 10:37 GMT
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.

Signature

-C. Moya
www.cmoya.com

> 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
[quoted text clipped - 25 lines]
>> collection editable via the PropertyEditor in WinForms.... why not
>> ASP.NET?).
Alessandro Zifiglio - 15 Apr 2006 11:32 GMT
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
> Nah. The control is way too complicated... consisting of several Controls
> and a bunch of layout using tables and such... bla bla.... even JavaScript
[quoted text clipped - 56 lines]
>>> collection editable via the PropertyEditor in WinForms.... why not
>>> ASP.NET?).
CMM - 15 Apr 2006 19:33 GMT
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.

Signature

-C. Moya
www.cmoya.com

Alessandro Zifiglio - 16 Apr 2006 07:37 GMT
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
> 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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.