Looks you have two different issues ?
Try IsClientScriptRegistered/RegisterClientScriptBlock. It allows to avoid
rendering the script if it has already been rendered previously...
For the second point you'll likely have to elaborate a bit...How do you look
at Page.Controls (your controls might be itself inside an inner control ?).
What if you start by looking at the HTML ? Do you see what your control is
supposed to render ? If should be a fairly good indication of wether or not
your control is actually in the control hierarchy...
Patrice
--
"Jason Kendall" <> a écrit dans le message de
news:...
> I have a server control that emits some client side script. Rather
> than have a script block for every instance of my server control, I'd
> like to have one block that contains the code for all of instances.
>
> I have looked into the OnInit, OnLoad and OnPreRender events, but the
> "MyBase.Page.Controls" collection never seems to contain my controls.
>
> Any tips would be appreciated.
>
>
> -Jason Kendall
>