473,326 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Collection properties in web controls

Suppose I have a collection class MyCollection (which implements IList)
a custom web control class MyControl that includes a property Items of
type MyCollection that will contain objects of class MyItem. MyControl,
MyItem, and MyCollection are all in the same namespace and, for that
matter, in the same DLL.

In MyControl:

private MyCollection items = new MyCollection();

[DesignerSerializationVisibility(DesignerSerializat ionVisibility.Content)]
[Editor(/*...*/)]
[PersistenceMode(PersistenceMode.InnerProperty)]
public MyCollection Items
{
get { return items; }
}

My custom collection editor works, I can add items, and they show up in
the ASPX file as:

<cc1:MyControl id="MyControl1" runat="server">
<Items>
<cc1:MyItem></cc1:MyItem>
</Items>
</cc1:MyControl>

This looks good, everything is persisted. (By the way, MyControl and
MyItem contain other properties that I'm not listing here for the sake
of clarity. Those properties show up, correctly, as attributes of the
respective tags.) But then a wavy red underline appears under Items. The
error message is "The active schema does not support the element items".
Then it becomes unable to display the control in design mode, showing
me an "Error Creating Control" message instead.

From my perspective, it's as though they gave us this tremendous power
to create complex custom controls, and then made them unusable as soon
as they hit the web page canvas. I must be missing something. Any ideas?
I read up on the active schema, but I can't believe I have to build a
whole schema for my class just so I can have a collection property.
Aug 14 '06 #1
0 892

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Sundown | last post by:
I am trying to create a custom button control for the web that, when clicked, disables and changes the text of itself and a bunch of other controls (in the collection). My goal is to end up with a...
2
by: Henry Craven | last post by:
I've inherited my pet hate, which is an ADP. Original developers have coded themselves into a corner with this, and I need to make lots of changes to many dozens of screens. With DAO I could...
5
by: Steve | last post by:
I have Access97, 2000 and XP installed. I'm developing an Access97 project for a client. I have the following code in the Open event of a form: Dim Cbr As Object Dim Ctl As Object On Error GoTo...
7
by: Mark Denardo | last post by:
Hi I have a TabControl object that I need to insert new TabPages into. To append them to the end of the Controls Collection I can do: tc.controls.add(tp) (tc - tabcontrol object) (tp -...
2
by: Brian | last post by:
NOTE ALSO POSTED IN microsoft.public.dotnet.framework.aspnet.buildingcontrols I have solved most of my Server Control Collection property issues. I wrote an HTML page that describes all of the...
2
by: James Doran | last post by:
Hello, I'd like to iterate through each Page of my ASP.NET project from within a Custom web control and access the Page.Controls collection. I've tried using Reflection on the web project...
0
by: Simon | last post by:
Hi I have developed a custom webcontrol like a Table (A) with a rows collection property (collection derived from CollectionBase) where I put one or more custom webcontrol (B). I need to hide...
0
by: GoCoogs | last post by:
Disclaimer: I'm a newbie that's been working with VB.net for under a month. I have two listboxes. Listbox1 contains collections. Selecting an item in listbox1 and pressing a control button sends...
3
by: Nunzio | last post by:
I am trying to add specific form controls to a VBA collection, so that I can pass the entire collection to another function, and access the individual controls later. I have tried several...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.