Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / September 2007

Tip: Looking for answers? Try searching our database.

.net Changing $ to _ ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paulo - 04 Sep 2007 20:10 GMT
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#

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.