A Custom Control as a property of antoher Custrom Control

Discussion in 'ASP .Net Web Controls' started by Björn Marthen, Nov 6, 2003.

  1. 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
     
    Björn Marthen, Nov 6, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rob Joosen

    Keep custom property-value in custom rendered control

    Rob Joosen, May 12, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    151
    Rob Joosen
    May 12, 2004
  2. Zarko Gajic

    Custom Attributes (AttributeTargets.Property) and Property Type

    Zarko Gajic, Apr 7, 2005, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    441
    Zarko Gajic
    Apr 7, 2005
  3. Björn Marthen

    How to get the left and top coordinate of custrom control?

    Björn Marthen, Dec 8, 2003, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    163
    Björn Marthen
    Dec 9, 2003
  4. abicz

    SVG Web custrom control

    abicz, Apr 27, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    473
    Ken Cox [Microsoft MVP]
    Apr 27, 2004
  5. anon
    Replies:
    0
    Views:
    215
Loading...

Share This Page