A component type as Control property

P

Per Erik Gransøe

Hi.

I have a control with a certain property of which data type is a component
class. At design time, all works fine - imagine there are several components
of this particular type on my ASP.NET form, and the property value on my
control can be selected between these existing components. Any time I change
the value, the aspx file gets updated with the new corresponing value in my
property attribute - all very fine. But at runtime, the framework fails to
show my page stating that:

Unable to generate code for a value of type 'MyComponent'. This error
occurred while trying to generate the property value for
MyComponentProperty.

Very understandingly as I supplied no StringConverter to my property that
could help converting the name of the property (a string) to an actual
reference to the instance of the component (of type MyComponent).
And now my question is:
How can I get a reference to MyComponent??? MyControl and MyComponent share
the same container - the ASP.NET-page, yet I don't know how this should be
made... Please help.

Regards,
Per
 

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

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top