473,327 Members | 2,081 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.

.net Changing $ to _ ?

The GridView is generating the radios name with $ on the source page, like:
"ctl00$Contentplaceholder2$grdContratos$ctl02$radi oSimNao", but when I pass
the jsFunc(RadioButton.clientID) on .net code it is generating:
"ctl00_Contentplaceholder2_grdContratos$ctl02_radi oSimNao", so the js doesnt
find the component...

What can I do?

Thanks

VS 2005 asp.net 2.0 C#
Sep 4 '07 #1
2 1627
There are 2 IDs one is ClientID another UniqueID. You can use UniqueID for
your case.

PS: Kills me too. I thought the ClientID is the one I must be using.....
"Paulo" <pr*****@uol.com.brwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
The GridView is generating the radios name with $ on the source page,
like: "ctl00$Contentplaceholder2$grdContratos$ctl02$radi oSimNao", but when
I pass the jsFunc(RadioButton.clientID) on .net code it is generating:
"ctl00_Contentplaceholder2_grdContratos$ctl02_radi oSimNao", so the js
doesnt find the component...

What can I do?

Thanks

VS 2005 asp.net 2.0 C#

Sep 4 '07 #2
ms went down a rat hole with names and ids. they started with ":" as
separator, but found this was illegal in an id or name, so replaced it
"$". then they realized "$" was illegal in an id when they wanted xhtml
compliance, so they changed it to "_" in an id.

so:

ClientId is the controls id (getElementById()), separator "_"
UniqueId is the controls name (getElementsByName()), separator "$"

note: starting an id with an "_" is not valid w3c html/xhtml, but they
still do it.

-- bruce (sqlwork.com)
Paulo wrote:
The GridView is generating the radios name with $ on the source page, like:
"ctl00$Contentplaceholder2$grdContratos$ctl02$radi oSimNao", but when I pass
the jsFunc(RadioButton.clientID) on .net code it is generating:
"ctl00_Contentplaceholder2_grdContratos$ctl02_radi oSimNao", so the js doesnt
find the component...

What can I do?

Thanks

VS 2005 asp.net 2.0 C#

Sep 5 '07 #3

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

Similar topics

3
by: Geoff Soper | last post by:
I'm trying to dynamically change the cursor of a couple of maps over an image. Basically the image is in an online photo system where there is a rotate mode. In this mode clicking on the left or...
2
by: Urs Vogel | last post by:
Hi When using XmlDocument, I can create nodes and attributes as I like. What I didn't achieve is changing the Value of a node (created with createElement), it claims that it's the wrong node...
1
by: Paul Reddin | last post by:
Hi, Can anyone tell me if the changing of DB Objects in Stinger has been improved ? e.g Changing optionality, renaming etc..... I spend an awful lot of time changing objects because many...
6
by: Eric | last post by:
I have an array, result. I populate the array and add it to an ArrayList. I then change result and add the new version to the ArrayList. However, when I go to review the ArrayList, all of the...
10
by: Altman | last post by:
I have only done a little programming in C++ so I am still learning but I am having a problem with a variable that is changing on me. I have tried this 2 ways with the same result. I have a...
3
by: John | last post by:
I have an asp.net control which on the first Load of the page has a unique ID something like: _ctl0__ctl1_GroupName__ctl1_ControlName and after the first postback it changes to: ...
1
by: Pablo | last post by:
I do not know like changing the color of bottom of: a menu, of the bar of the title of form, messagebox?
32
by: deko | last post by:
I have a popup form with a textbox that is bound to a memo field. I've been warned about memo fields so I'm wondering if I should use this code. Is there any risk with changing the form's...
18
by: Chris Hills | last post by:
A lesson in Posting How many C.L.C group posters does it take to change a C light bulb? 1 to change the light bulb and to post that the light bulb has been changed 14 to share similar...
1
by: DrJarmin | last post by:
Hello The problem is this: in the criteria for a list box I reference the parent form - and Access KEEPS changing the criteria for one that won't work. Details below: I have a couple of list...
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...
1
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: 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)...
1
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.