, is it possible that the separator can change, and if so, is there a p...">

ASP.NET Unique Identifier Constraint

The unique control is removed using '$', is it possible that the separator can change, and if so, is there a property somewhere that contains the separator character?

+4
source share
2 answers

Given that there are protected IdSeparator and ClientIDSeparator properties, I would consider it as subject to change and avoid writing code that makes the assumption that a particular character is used as a delimiter. Both of these properties are of type Char , so I’m unlikely to see them switch to using multi-character delimiters, but this is just an assumption, as well as something that I would not rely on.

+2
source

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

I came across some kind of legacy JavaScript code that was passed to UniqueID and analyzed it like this:

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

Switching to a later version of the CLR caused this code to break because, as pointed out in this question, the delimiter is now $, not ::.

0
source

Source: https://habr.com/ru/post/1304516/


All Articles