Custom Container Control Changes the Input Tag Names of Child Controls???

Discussion in 'ASP .Net' started by Chris Newby, Feb 25, 2005.

  1. Chris Newby

    Chris Newby Guest

    I have a custom control that derives from the WebControls.Panel class.

    In a given ASPX document, I have an instance of my custom control with ID
    set to "MyControl".

    Then I put a WebControls.TextBox control inside my custom control with ID
    set to "MyTextBox".

    When this page renderes, inspection of the HTML source shows that the Name
    attribute of the input tag generated from MyTextBox is now actually
    "MyControl:MyTextBox" and not just "MyTextBox".

    Trying a similiar scenario, but using the standard WebControls.Panel as a
    container instead of my panel-derived custom control, the input tag Name
    attribute is as expected, "MyTextBox".

    So, I figure I'm cleary doing something wrong.

    Any thoughts?

    TIA//
    Chris Newby, Feb 25, 2005
    #1
    1. Advertising

  2. Chris Newby

    Vaibhav Guest

    One reasoning would be how the system treats the controls on a page. I
    think in case of custom control the textbox control is taken to be part of
    the custom control, but in case of a system control the inserted text box is
    also taken as part of the page besides being part of the panel.

    HTH

    "Chris Newby" <> wrote in message
    news:...
    >I have a custom control that derives from the WebControls.Panel class.
    >
    > In a given ASPX document, I have an instance of my custom control with ID
    > set to "MyControl".
    >
    > Then I put a WebControls.TextBox control inside my custom control with ID
    > set to "MyTextBox".
    >
    > When this page renderes, inspection of the HTML source shows that the Name
    > attribute of the input tag generated from MyTextBox is now actually
    > "MyControl:MyTextBox" and not just "MyTextBox".
    >
    > Trying a similiar scenario, but using the standard WebControls.Panel as a
    > container instead of my panel-derived custom control, the input tag Name
    > attribute is as expected, "MyTextBox".
    >
    > So, I figure I'm cleary doing something wrong.
    >
    > Any thoughts?
    >
    > TIA//
    >
    >
    Vaibhav, Feb 25, 2005
    #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. shruds
    Replies:
    1
    Views:
    744
    John C. Bollinger
    Jan 27, 2006
  2. Jeff Rodriguez
    Replies:
    23
    Views:
    1,083
    David Schwartz
    Dec 9, 2003
  3. gerry
    Replies:
    0
    Views:
    379
    gerry
    Jul 22, 2008
  4. gerry
    Replies:
    5
    Views:
    461
    gerry
    Aug 6, 2008
  5. TR
    Replies:
    0
    Views:
    262
Loading...

Share This Page