Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > A Custom Control as a property of antoher Custrom Control

Reply
Thread Tools

A Custom Control as a property of antoher Custrom Control

 
 
Björn Marthen
Guest
Posts: n/a
 
      11-06-2003
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(DesignerSerializat ionVisibility.Content),Pe
rsistenceMode(PersistenceMode.Attribute),NotifyPar entProperty(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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Attributes (AttributeTargets.Property) and Property Type Zarko Gajic ASP .Net Building Controls 0 04-07-2005 02:20 PM
Custom Control : One custom property to array of controls anon ASP .Net Web Controls 0 01-15-2005 11:32 AM
Keep custom property-value in custom rendered control Rob Joosen ASP .Net Building Controls 0 05-12-2004 11:56 AM
SVG Web custrom control abicz ASP .Net Web Controls 1 04-27-2004 06:58 PM
How to get the left and top coordinate of custrom control? Björn Marthen ASP .Net Web Controls 3 12-09-2003 07:57 AM



Advertisments