469,887 Members | 1,201 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,887 developers. It's quick & easy.

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

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//
Nov 19 '05 #1
1 1530
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" <CA*****************@hotmail.com> wrote in message
news:u9**************@tk2msftngp13.phx.gbl...
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//

Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Pham Nguyen | last post: by
7 posts views Thread by Girish | last post: by
reply views Thread by pabloazorin | last post: by
11 posts views Thread by Nick Gilbert | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.