https://i.sstatic.net/dVjHt.jpg
I've always struggled to grasp the true purpose of using the Control
, Type
, and Key
in this particular class.
Typically, I would use it with: this, GetType(), "xx"
however, now I am determined to gain a deeper understanding.
msdn :
Control: "the control that is registering the client script"
but why does it matter who registers it? The script will end up in the head of the page anyway....
Type: "the type of the client script block"
type? It's just javascript. Why do they require a different type from me?
Key: "a unique indentifier"
I see the use for this - especially for cases where later removal might be necessary... however, I crave more complex explanations.
Could someone provide a real life scenario where I absolutely have to manipulate these parameters?