EAPCtrlUtilsUniqueIDSnapshot Method |
Accessing a control's UniqueID or ClientID too early can cause the ID to be cached. This is perfectly fine if the control's entire tree
of NamingContainers has been assembled, but accessing the ID before that can cause a partial ID to be constructed and cached.
Once
cached there doesn't appear to be a way to clear it!
This methods contructs the UniqueID for the control from the control ID's in the control's NamingContainer hierarchy thus preventing
unwanted caching.
Here are a couple of reference articles:
Accessing ClientID or UniqueID too early can cause issues.Net Control.UniqueID implementation
Namespace:
NetQuarry
Assembly:
EAP.Core (in EAP.Core.dll) Version: 2.0.0.0 (4.6.8.0)
Syntax public static string UniqueIDSnapshot(
Control ctrl,
char separator
)
Public Shared Function UniqueIDSnapshot (
ctrl As Control,
separator As Char
) As String
Parameters
- ctrl
- Type: System.Web.UIControl
The control for which to contruct the UniqueID. - separator
- Type: SystemChar
The control ID separator character (typically '$').
Return Value
Type:
StringThe snapshot of the control's UniqueID in the current control tree.
See Also