How to make a custom control's control public to parent container by default?

Discussion in 'ASP .Net' started by farmer, Oct 24, 2005.

  1. farmer

    farmer Guest

    as title.
    farmer, Oct 24, 2005
    #1
    1. Advertising

  2. Just declare it as public.

    Public MyControl as SomeControl

    --
    I hope this helps,
    Steve C. Orr, MCSD, MVP
    http://SteveOrr.net


    "farmer" <> wrote in message
    news:...
    > as title.
    >
    Steve C. Orr [MVP, MCSD], Oct 24, 2005
    #2
    1. Advertising

  3. farmer

    farmer Guest

    I am meaning such a custom control:

    <script language="C#" runat="server">
    </script>
    <asp:Button ID=Search Text="Search" runat=Server>

    I want Button:"Search" to be a public Control directory,not add a
    additional represent variable and get/set for access the inner control
    such as:

    <script language="C#" runat="server">
    public string MySearch{
    get{...}
    set{...}
    }
    </script>
    <asp:Button ID=Search Text="Search" runat=Server>

    this way,I can use the inner control directly such as:
    MyContrl.Search.Text="xxx";
    farmer, Oct 24, 2005
    #3
    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. Charles A. Lackman
    Replies:
    1
    Views:
    1,320
    smith
    Dec 8, 2004
  2. SpamProof
    Replies:
    0
    Views:
    527
    SpamProof
    Oct 21, 2003
  3. Kevin Spencer
    Replies:
    2
    Views:
    3,289
    Kevin Spencer
    Sep 15, 2004
  4. dliu
    Replies:
    0
    Views:
    1,098
Loading...

Share This Page