A Custom Control as a property of antoher Custrom Control

B

Björn Marthen

Hello,

I wrote two custom controls. The first control (dbconnection)
inherits from "System.ComponentModel.Component" and has the properties for
the database connection. The second control inherits from
"System.Web.UI.WebControls.WebControl" and has as property the dbconnection
control (the first control).

--------
[Bindable(true), Category("Appearance")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content),Pe
rsistenceMode(PersistenceMode.Attribute),NotifyParentProperty(true)]
public dbconnection databaseConnection
{
get
{
return _dbconnection;
}
set
{
_dbconnection = value;
}
}
--------

Now i create in the VS.Net designer an object from the first and the second
control. Now i can select in the property of the second control the first
control as the database connection. When i save the projekt and reopen it,
the property of the second control is null. The second property has
forgotten that the fist control is the database connection. In the ASP-Code
appears the name of the first control. But why forget the second control the
property in the designer?

--------
<cc1:Control1 id="Control4" runat="server"
databaseConnection="dbconnection1"></cc1:Control1>
--------

Can anybody help me?
Does anybody understand my problem because of my bad english ;) ?

regards,
Björn Marthen
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top