473,327 Members | 1,892 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,327 software developers and data experts.

ContentPlaceHolder changes the name of my dynamic controls

i've got a website using masterpages, on a certain page i'm using
dynamic added controls with specific names like "q1, q2, ...", but when
i look in the sourcecode of the website it makes it like :

ctl00_ContentPlaceHolder1_q1 or even ctl00$ContentPlaceHolder1$q1

how can i fix this?

Dec 6 '06 #1
1 1548
"Roxxe" <ha*******@gmail.comwrote in message
news:11**********************@79g2000cws.googlegro ups.com...
i've got a website using masterpages, on a certain page i'm using
dynamic added controls with specific names like "q1, q2, ...", but when
i look in the sourcecode of the website it makes it like :

ctl00_ContentPlaceHolder1_q1 or even ctl00$ContentPlaceHolder1$q1
Yes, it will do that.
how can i fix this?
You can't - you can give the content placeholder an explicit ID, but that
still won't guarantee that the name will always be the same, especially if
the control is contained within another container control e.g. a Panel or a
Table.

Luckily, you never need to worry about this. Any time you need to know the
id of the control client-side (e.g. in JavaScript validation routines), you
can get ASP.NET to provide it for you e.g.

alert('The q1 control is actually called <%=q1.ClientID%>');
Dec 6 '06 #2

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

Similar topics

2
by: Urs Eichmann | last post by:
Hello, I want to define a MasterPage which already has some asp:Textbox and other controls defined inside a ContentPlaceHolder. The idea is that the user of the master page just changes two or...
6
by: Lance Geeck | last post by:
I have a simple form where I am using a dataset called Client. On the data entry screen, there are name, address, city state and zip. I have the fields bound to the dataset field. (Properties...
4
by: Greg | last post by:
How do I programmatically load an .aspx page into the contentplaceholder? Similar to what would happen in the "navigateURL" property when clicking on a hyperlink on the master page. . . ASP .NET...
0
by: nickster | last post by:
For some reason when I use asp controls for the default content of a ContentPlaceHolder, they do not get rendered. Static content is rendered just fine however! Specifically I'm using multiple...
0
by: nicomp | last post by:
When I create a web form in VS 2005 I have a problem. I created a MasterPage with a ContentPlaceHolder object on it. Then I created a detail page that refrenced the Master Page. When I drag...
0
by: DE3A10 | last post by:
I know how to create text box dinamiclly. I have two problems. 1. I want to create text boxex inside of a contentPlaceholder. I'm using master pages. 2. Every time I create text boxes they...
3
by: jobs | last post by:
Hello. I have a master page with ContentPlaceHolder under a html Div tag. That DIV tag has CSS that positions it. While in Visual Studio design view, that div tag and contentplace holder does...
1
by: Joseph Gruber | last post by:
Hi all. I've created a master page that has a ContentPlaceHolder (mainContent) on it. On a child page I've put a dynamic treeview control into mainContent. The TreeView builds itself...
1
by: =?Utf-8?B?ampmbGFzaA==?= | last post by:
I have a master page with a contentplaceholder object. When creating content pages, I'm adding controls to the contentplaceholder area. The contentplaceholder is not stretching so that I can...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
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...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
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...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.