ASP.NET - how to get the properties of a component?

Discussion in 'ASP .Net' started by =?ISO-8859-1?Q?Mika=EBl_PLOUHINEC?=, Oct 25, 2006.

  1. Hello,

    I work in a ASP.NET (C#) project. I would like to create an user control
    with a label and a textBox.

    My component myTextBox.ascx is present in my page (aspx) with
    <toto:TextBoxPerso ID="TextBoxPerso1" runat="server" /><br />

    So I would like to manage the component of my component for example in
    the code of my aspx page.

    I find I can do that with
    ((Label)(this.TextBoxPerso1.FindControl("label"))).Text = "Label 2";

    But is there a way to "publish" several properties of my component in
    order to access to this like
    this.TextBoxPerso1.getLabel().Text = "label 2";

    Thanks a lot.

    Mike.
     
    =?ISO-8859-1?Q?Mika=EBl_PLOUHINEC?=, Oct 25, 2006
    #1
    1. Advertising

  2. You can set your own properties using the technique shown here:

    http://samples.gotdotnet.com/quicks...perty.src&file=CS\SimpleSubProperty.cs&font=3


    "Mikaƫl PLOUHINEC" <> wrote in message
    news:uclIEIE%...
    > Hello,
    >
    > I work in a ASP.NET (C#) project. I would like to create an user control
    > with a label and a textBox.
    >
    > My component myTextBox.ascx is present in my page (aspx) with
    > <toto:TextBoxPerso ID="TextBoxPerso1" runat="server" /><br />
    >
    > So I would like to manage the component of my component for example in the
    > code of my aspx page.
    >
    > I find I can do that with
    > ((Label)(this.TextBoxPerso1.FindControl("label"))).Text = "Label 2";
    >
    > But is there a way to "publish" several properties of my component in
    > order to access to this like
    > this.TextBoxPerso1.getLabel().Text = "label 2";
    >
    > Thanks a lot.
    >
    > Mike.
     
    Ken Cox [Microsoft MVP], Oct 26, 2006
    #2
    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. Soni
    Replies:
    0
    Views:
    1,106
  2. Karuppasamy

    com+ component and Component Service

    Karuppasamy, Jan 13, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    636
    Karuppasamy
    Jan 13, 2004
  3. Karuppasamy

    com+ component and Component Service

    Karuppasamy, Jan 13, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    2,568
  4. nicholas
    Replies:
    3
    Views:
    879
    nicholas
    Oct 4, 2004
  5. Miguel Minora
    Replies:
    1
    Views:
    163
    Miguel Minora
    Jan 11, 2005
Loading...

Share This Page