473,396 Members | 2,011 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,396 software developers and data experts.

ID of dynamically inserted user control

I am inserting controls dynamically into my page; both Web Controls and User
Controls. Code Below..

I noticed that inspite of specifying the ID for the user controls, in the
HTML, the name is set to : myUC2:_ctl0.. Whats with the :_ctl0?? How can I
get rid of it?

Bijoy

-----------------

Dim newControl As Control

for count = 1 to 5
newControl = New Textbox()
newControl.ID = "myTextBox" & count
Page.Controls.Add(newControl)
next

For User Controls I do

Dim uc As UserControl

for count = 1 to 5
uc = LoadControl("file.ascx")
uc.ID = "myUC" & count
Page.Controls.Add(uc)
next

Nov 18 '05 #1
1 1118
You can't unless you give every inserted control its ID yourself. If your ID
is "MyID" it look like this: <containerID>:MyID.
And why would you need to get rid of it?
"Bijoy Naick" <b_*****@yahoo.ca> wrote in message
news:ui**************@tk2msftngp13.phx.gbl...
I am inserting controls dynamically into my page; both Web Controls and
User
Controls. Code Below..

I noticed that inspite of specifying the ID for the user controls, in the
HTML, the name is set to : myUC2:_ctl0.. Whats with the :_ctl0?? How can I
get rid of it?

Bijoy

-----------------

Dim newControl As Control

for count = 1 to 5
newControl = New Textbox()
newControl.ID = "myTextBox" & count
Page.Controls.Add(newControl)
next

For User Controls I do

Dim uc As UserControl

for count = 1 to 5
uc = LoadControl("file.ascx")
uc.ID = "myUC" & count
Page.Controls.Add(uc)
next

Nov 18 '05 #2

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

Similar topics

7
by: Tim T | last post by:
Hi, I have the need to use dynamically loaded user controls in a webform page. I have the controls loading dynamically, and that part works fine. this is the code used in a webform to dynamically...
1
by: Josh | last post by:
Hi Guys, I have been having a big problem with trying to pass parameters into a user control when the user control is dynamically loaded into a placholder. I am developing in c#. I have get...
1
by: Kamal Jeet Singh | last post by:
Hi Friends !! I am have facing problem in controlling the dynamically created controls on web page. The problem Scenario is Scenario:- My requirement is to load the web user controls on the...
0
by: lucky | last post by:
hi there!!! as the title tells. my problem is that, i'm trying to add row which contains a user control, into the table dynamically. but every time i tried to add row, it adds only one row into...
1
by: Reza Nabi | last post by:
Bakground: I have a webform (LoadCtl.aspx) which loads the user control to a placeholder dynamically based on the ctlName querystring passed in the URL. Webform (LoadCtl.aspx) also passes a...
1
by: Jeffrey Todd | last post by:
I have successfully created functionality that mostly models what I'm trying to do - which is dynamically insert controls into a user control (ascx), and insert validation controls, also...
1
by: adamredwards | last post by:
I have a page with some form elements that are dynamically generated. They are inserted into the dom by first cloning a node, changing the values like name, and then inserted with insertBefore(). ...
6
by: | last post by:
I have made some user controls with custom properties. I can set those properties on instances of my user controls, and I have programmed my user control to do useful visual things in response to...
1
by: hardieca | last post by:
Hi, I'm building a multi-lingual CMS. The user can add as many languages as he likes. The user will be able to create sections for different content (General, News Releases, etc...) in the db...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.