Id of child controls for UserControl

S

Shimon Sim

Is there a consistent way to find out the id of child controls of the
UserControl.

Should I just use this.name+"_+control.Id;?
Shimon
 
K

Kim Quigley

In the code behind of your user control, did you add your controls as public
properties? Or are you talking about something totally different?
 
S

Shimon Sim

I need to register some script block.
The idea of the control is to show Modal Dialog showModalDialog() and insert
some values in the hidden txtboxes of the UserControl. For this I need to
know id of the hidden boxes (i just use TextBox for that with
Attributes.Add("style"."display: none")
names of text boxes are static. - I just add them in the designer - no
dinamic code for this.
Thanks,
Shimon.
 
K

Kim Quigley

I think you can do this by creating public properties in the user control.
Then you would be able to get the idea of a textbox in the user control like
this:

ControlName.PublicPropertyName.ClientID

In the user control you create a public property of type Textbox.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top