The GridView is generating the radios name with $ on the source page, like:
"ctl00$Contentplaceholder2$grdContratos$ctl02$radioSimNao", but when I pass
the jsFunc(RadioButton.clientID) on .net code it is generating:
"ctl00_Contentplaceholder2_grdContratos$ctl02_radioSimNao", so the js doesnt
find the component...
What can I do?
Thanks
VS 2005 asp.net 2.0 C#
George Ter-Saakov - 04 Sep 2007 21:24 GMT
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.....
> The GridView is generating the radios name with $ on the source page,
> like: "ctl00$Contentplaceholder2$grdContratos$ctl02$radioSimNao", but when
[quoted text clipped - 7 lines]
>
> VS 2005 asp.net 2.0 C#
bruce barker - 05 Sep 2007 01:03 GMT
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)
> The GridView is generating the radios name with $ on the source page, like:
> "ctl00$Contentplaceholder2$grdContratos$ctl02$radioSimNao", but when I pass
[quoted text clipped - 7 lines]
>
> VS 2005 asp.net 2.0 C#