473,320 Members | 1,853 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Id of child controls for UserControl

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
Nov 19 '05 #1
6 1381
In the code behind of your user control, did you add your controls as public
properties? Or are you talking about something totally different?
"Shimon Sim" <sh**********@community.nospam> wrote in message
news:uQ*************@TK2MSFTNGP12.phx.gbl...
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

Nov 19 '05 #2
You probably shouldn't just use that

What is it you are trying to do? No doubt a better solution exists...

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Shimon Sim" <sh**********@community.nospam> wrote in message
news:uQ*************@TK2MSFTNGP12.phx.gbl...
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

Nov 19 '05 #3
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.

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:eY**************@TK2MSFTNGP15.phx.gbl...
You probably shouldn't just use that

What is it you are trying to do? No doubt a better solution exists...

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Shimon Sim" <sh**********@community.nospam> wrote in message
news:uQ*************@TK2MSFTNGP12.phx.gbl...
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


Nov 19 '05 #4
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.

"Shimon Sim" <sh**********@community.nospam> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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.

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:eY**************@TK2MSFTNGP15.phx.gbl...
You probably shouldn't just use that

What is it you are trying to do? No doubt a better solution exists...

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Shimon Sim" <sh**********@community.nospam> wrote in message
news:uQ*************@TK2MSFTNGP12.phx.gbl...
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



Nov 19 '05 #5
I think that I just need ClientID property.
Thanks.
Shimon.
"Kim Quigley" <ki********@hotmail.com> wrote in message
news:uZ**************@TK2MSFTNGP09.phx.gbl...
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.

"Shimon Sim" <sh**********@community.nospam> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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.

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:eY**************@TK2MSFTNGP15.phx.gbl...
You probably shouldn't just use that

What is it you are trying to do? No doubt a better solution exists...

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Shimon Sim" <sh**********@community.nospam> wrote in message
news:uQ*************@TK2MSFTNGP12.phx.gbl...
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



Nov 19 '05 #6
Glad you were able to figure it out
"Shimon Sim" <sh**********@community.nospam> wrote in message
news:uF**************@TK2MSFTNGP15.phx.gbl...
I think that I just need ClientID property.
Thanks.
Shimon.
"Kim Quigley" <ki********@hotmail.com> wrote in message
news:uZ**************@TK2MSFTNGP09.phx.gbl...
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.

"Shimon Sim" <sh**********@community.nospam> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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.

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:eY**************@TK2MSFTNGP15.phx.gbl...
You probably shouldn't just use that

What is it you are trying to do? No doubt a better solution exists...

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Shimon Sim" <sh**********@community.nospam> wrote in message
news:uQ*************@TK2MSFTNGP12.phx.gbl...
> 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
>



Nov 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: james | last post by:
I have a custom UserControl, which can have many sub class levels derived from it. I want to be able to discover all the components at Load time, but the only components I can see from the base...
2
by: Dave Veeneman | last post by:
Is there a simple way to pass drag-and-drop events to a child control in a UserControl? Here's an example: I have created a UserControl which contains a treeview and some text boxes. I want to...
0
by: Scott McChesney | last post by:
I have a problem I hope you folks can help me with. I have an application that is using a tab-based interface, with the ability for users to drag an item from a ListBox onto the tab control. ...
10
by: Charles Law | last post by:
For some reason, when I click the X to close my MDI parent form, the action appears to be re-directed to one of the MDI child forms, and the parent remains open. I am then unable to close the...
2
by: lotus | last post by:
HI All.. I'm realtively new to C#. I have MainForm which includes Parent usercontol, and this parent usercontrol also contains child usercontrol. MainForm --> Parent usercontrol --> child...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.