views:

124

answers:

2

The UniqueID of a control is delemited with the '$', is it possble that the delimiter can change, and if so, is there a property somewhere that contains the delimiting character?

+2  A: 

Given that there are the protected properties IdSeparator and ClientIDSeparator, I would regard it as subject to change and avoid writing code that make assumptions that a certain character is used as separator. Both those properties are of the type Char, so I would find it unlikely that they would change into using multiple-character separators, but that is just an guess, and also something that I would avoid relying on.

Fredrik Mörk
A: 

I would say that it is dangerous to rely on the exact character used as the delimiter.

I came across some legacy JavaScript code that was passed a UniqueID and parsed it like this:

theform.__EVENTTARGET.value = s.split(":")[0];
theform.__EVENTARGUMENT.value = s.split(":")[1];

Moving to a more recent version of the CLR caused this code to break because, as indicated in this question, the delimiter is now '$', not ':'.

Buggieboy