Setting web custom control properties at design time

Discussion in 'ASP .Net Building Controls' started by N Kumar, Feb 21, 2006.

  1. N Kumar

    N Kumar Guest

    I am developing a Web custom control whose properties (such as text) I would
    like to map to other control properties (such as textbox1.text) or variables
    of the web form at design time. Is this possible?
    --
    NK
    N Kumar, Feb 21, 2006
    #1
    1. Advertising

  2. N Kumar

    Teemu Keiski Guest

    Hi,

    yes it is. One way is to write a composite server control.

    Here's a sample
    http://msdn.microsoft.com/library/d.../cpguide/html/cpconcompositecontrolsample.asp

    And here's one good article: http://aspalliance.com/359

    If you use ASp.NET 2.0 see: http://dotnet.sys-con.com/read/171169.htm
    (with ASP.NET 2.0 you'd inherit directly from CompositeControl base class)

    --
    Teemu Keiski
    ASP.NET MVP, AspInsider
    Finland, EU
    http://blogs.aspadvice.com/joteke


    "N Kumar" <> wrote in message
    news:...
    >I am developing a Web custom control whose properties (such as text) I
    >would
    > like to map to other control properties (such as textbox1.text) or
    > variables
    > of the web form at design time. Is this possible?
    > --
    > NK
    Teemu Keiski, Feb 22, 2006
    #2
    1. Advertising

  3. N Kumar

    N Kumar Guest

    Thanks Teemu.

    But I am not looking to access the child controls within the composite
    control. This is definitely possible as you indicated.

    What I am looking for is, I have a, say composite control with property say
    Text. Now when a developer uses my control and tries to assign the Text
    property through Property window, I would like to show him/her, the other
    Textbox names in that web form. Say the developer has assigned (mapped) to
    Textbox1, at runtime, the Text property of the composite control should take
    the text value from Textbox1.

    Is such a mapping possible?

    --
    NK


    "Teemu Keiski" wrote:

    > Hi,
    >
    > yes it is. One way is to write a composite server control.
    >
    > Here's a sample
    > http://msdn.microsoft.com/library/d.../cpguide/html/cpconcompositecontrolsample.asp
    >
    > And here's one good article: http://aspalliance.com/359
    >
    > If you use ASp.NET 2.0 see: http://dotnet.sys-con.com/read/171169.htm
    > (with ASP.NET 2.0 you'd inherit directly from CompositeControl base class)
    >
    > --
    > Teemu Keiski
    > ASP.NET MVP, AspInsider
    > Finland, EU
    > http://blogs.aspadvice.com/joteke
    >
    >
    > "N Kumar" <> wrote in message
    > news:...
    > >I am developing a Web custom control whose properties (such as text) I
    > >would
    > > like to map to other control properties (such as textbox1.text) or
    > > variables
    > > of the web form at design time. Is this possible?
    > > --
    > > NK

    >
    >
    >
    N Kumar, Feb 23, 2006
    #3
  4. N Kumar

    N Kumar Guest

    Thanks Teemu.

    But I am not looking to set the property value from child controls of the
    composite control. This is very much possible as you indicated.

    What I am trying to do is, say, I have a composite control with a property
    Text. Now when a developer uses my control, and when he/she tries to assign
    the Text property through the property window, I would like to show him a
    list which has names of other Textboxes in the Web form. Now say, the
    developer has assigned (mapped) it to Textbox1, then at runtime, the Text
    property of Textbox1 should be assigned to the Text property of the composite
    control, during initialization of the Web form.

    Is this possible?
    --
    NK


    "N Kumar" wrote:

    > I am developing a Web custom control whose properties (such as text) I would
    > like to map to other control properties (such as textbox1.text) or variables
    > of the web form at design time. Is this possible?
    > --
    > NK
    N Kumar, Feb 23, 2006
    #4
  5. N Kumar

    Teemu Keiski Guest

    Hi,

    basically providing a list of controls can be done with a custom type
    converter, when it would pick IDs of other controls and set such into the
    property.Is that what you mean? For example similar when you set
    ControlToValidate of a validator control. it shows you list of all controls
    having ValidationProperty attribute applied. Yes, such is done with a custom
    type copnverter.

    --
    Teemu Keiski
    ASP.NET MVP, AspInsider
    Finland, EU
    http://blogs.aspadvice.com/joteke

    "N Kumar" <> wrote in message
    news:...
    > Thanks Teemu.
    >
    > But I am not looking to access the child controls within the composite
    > control. This is definitely possible as you indicated.
    >
    > What I am looking for is, I have a, say composite control with property
    > say
    > Text. Now when a developer uses my control and tries to assign the Text
    > property through Property window, I would like to show him/her, the other
    > Textbox names in that web form. Say the developer has assigned (mapped) to
    > Textbox1, at runtime, the Text property of the composite control should
    > take
    > the text value from Textbox1.
    >
    > Is such a mapping possible?
    >
    > --
    > NK
    >
    >
    > "Teemu Keiski" wrote:
    >
    >> Hi,
    >>
    >> yes it is. One way is to write a composite server control.
    >>
    >> Here's a sample
    >> http://msdn.microsoft.com/library/d.../cpguide/html/cpconcompositecontrolsample.asp
    >>
    >> And here's one good article: http://aspalliance.com/359
    >>
    >> If you use ASp.NET 2.0 see: http://dotnet.sys-con.com/read/171169.htm
    >> (with ASP.NET 2.0 you'd inherit directly from CompositeControl base
    >> class)
    >>
    >> --
    >> Teemu Keiski
    >> ASP.NET MVP, AspInsider
    >> Finland, EU
    >> http://blogs.aspadvice.com/joteke
    >>
    >>
    >> "N Kumar" <> wrote in message
    >> news:...
    >> >I am developing a Web custom control whose properties (such as text) I
    >> >would
    >> > like to map to other control properties (such as textbox1.text) or
    >> > variables
    >> > of the web form at design time. Is this possible?
    >> > --
    >> > NK

    >>
    >>
    >>
    Teemu Keiski, Feb 23, 2006
    #5
    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. Replies:
    0
    Views:
    707
  2. Replies:
    1
    Views:
    357
    Teemu Keiski
    Jul 2, 2003
  3. Peter

    properties not showing in properties window at design time

    Peter, Dec 10, 2003, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    200
    Lostinet.Web Support
    Dec 10, 2003
  4. George
    Replies:
    4
    Views:
    182
    Jeffrey Tan[MSFT]
    Jan 19, 2004
  5. Nathan Bidwell

    Custom properties in a User Control at Design time

    Nathan Bidwell, Sep 2, 2003, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    324
    Nathan Bidwell
    Sep 3, 2003
Loading...

Share This Page