G
Guest
Hi. Two questions about "RegisterClientScriptBlock":
1. I want to be able to insert a script block without having to worry about
whether the "key" is unique. As it turns out, if a script block with that key
has already been registered, I can't register another block with the same
key. So the problem is, if I have functions that just register script blocks,
am I going to have to dynamically generate keys for each one with some kind
of awful "counter" or something? Is there a way to leave this parameter NULL
or something and have it automatically create a new key?
2. When I provide the "Key" parameter to this function, I would have thought
that it would be somehow output as an attribute to the <script /> tag that is
generated on the client. Yet the <Script /> tag says nothing. So what's the
"key" for except to manage uniqueness on the server side? Maybe that *is* all
it's for.
Thanks.
Alex
1. I want to be able to insert a script block without having to worry about
whether the "key" is unique. As it turns out, if a script block with that key
has already been registered, I can't register another block with the same
key. So the problem is, if I have functions that just register script blocks,
am I going to have to dynamically generate keys for each one with some kind
of awful "counter" or something? Is there a way to leave this parameter NULL
or something and have it automatically create a new key?
2. When I provide the "Key" parameter to this function, I would have thought
that it would be somehow output as an attribute to the <script /> tag that is
generated on the client. Yet the <Script /> tag says nothing. So what's the
"key" for except to manage uniqueness on the server side? Maybe that *is* all
it's for.
Thanks.
Alex