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

TextBox ID problem

Hi,

I have a TextBox inside a usercontrol, in the onInit method i put its ID
property to a string value, like this: MyTextBox.ID="test";

but when the user control is renderer into the internet explorer and i see
the source code, i see that <input type text id=_ctl1_test>

Why im getting this if i assign to the ID the value test?
How could i solve it?

--
Thanks
Kind Regards.
Josema
Nov 16 '05 #1
2 967
Josema,

Is it possible that the control has been rendered already to the
response stream? This is the only reason I could think of that this would
do this.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Josema" <Je******@ocu.org> wrote in message
news:7F**********************************@microsof t.com...
Hi,

I have a TextBox inside a usercontrol, in the onInit method i put its ID
property to a string value, like this: MyTextBox.ID="test";

but when the user control is renderer into the internet explorer and i see
the source code, i see that <input type text id=_ctl1_test>

Why im getting this if i assign to the ID the value test?
How could i solve it?

--
Thanks
Kind Regards.
Josema

Nov 16 '05 #2
Hello!

The controls identifier is used to determine the position of the control in
the hierarchical control tree.

The identifier is also, amongst others, used by ASP.NET to determine which
control recieves the postback datawith the same ID from eachother, which is
why ASP.NET renders a hierarchical identifier that is composed of the IDs of
all the ancestor controls plus the ID of your control.

The control is correctly assigned your control and you can retrieve the
control using the "FindControl()" method on the Page and UserControl
classes. If you need to reference the control clientside, you can use the
"UniqueID" property of the control that returns a hierarchical string
identifier for the control.

Does this answer your question? I know it was a bit verbose, but I haven't
seen any ways of actually getting a simple identifier assigned a control.

--
venlig hilsen / with regards
anders borum
--
Nov 16 '05 #3

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

Similar topics

2
by: Jesper | last post by:
Last week I posted this for the first time. However, I didn't get any useable solution to my problem. I'm very keen on getting this problem solved, so please excuse me for trying again. I'll try to...
7
by: Joel Finkel | last post by:
Folks, I have a form that has several TextBoxes, some of which have the TextMode set to MultiLine. Each is pre-loaded with data from a database. The user is allowed to modify each entry. The...
7
by: Peter D.C. | last post by:
Hi I want to update data hold in several textbox controls on an asp.net form. But it seems like it is the old textbox values that is "re-updates" through a stored procedure who updates a SQL...
8
by: tshad | last post by:
I cannot seem to get the asp:textbox to use classes. Style works fine. I am trying to set the textbox to act like a label in some instance so it doesn't have a border, readonly and the background...
3
by: Brad Rogers | last post by:
All, Being immersed in vb.net and trying CSharp after almost a year I forgot the differences. I like vb fixing the uppercase/lowercase names and seeming to be more flexible to code entry. ...
8
by: Filipe Marcelino | last post by:
Hi, I'm trying to create a textbox inheriting from the standard textbox. I would like to: 1. repaint the textbox border; 2. define a color for that border; Till now I made this:
1
by: rn5a | last post by:
I want to create a custom control that encapsulates a Button & a TextBox. When the Button is clicked, the user is asked a question using JavaScript confirm (which shows 2 buttons - 'OK' &...
4
by: =?Utf-8?B?UmVuYXVkIExhbmdpcw==?= | last post by:
Hello, I have a strange yet very simple problem with the asp.net Textbox web control. On an empty asp.net page, add a single asp:TextBox control with Autopostback=false with nothing else on...
0
by: sjickells | last post by:
Hi I am having a problem using asp:TextBox's in a transparent table. I have a background image on the page and a table in the middle of the page. I have set the background colour of the table...
9
by: =?Utf-8?B?dHBhcmtzNjk=?= | last post by:
OK I have some Chinese text in sql server column that looks like this: 12大专题调研破解广东科学发展难题 This is unicode? Anyway, I put this data into a text area like this:...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...

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.