views:

422

answers:

1

I'm using Page.ClientScript.RegisterClientScriptBlock on PreRender in a nested Server Control environment. The script does not get written to the page, does anyone know why this happens?

protected override void OnPreRender(EventArgs e)
    {
        Page.ClientScript.RegisterClientScriptBlock(typeof(System.Web.UI.Page), "FMMedia",
            FMServerControls.Resources.Media.Media.MediaScript, true);

        base.OnPreRender(e);
    }
A: 

Page.ClientScript.RegisterStartupScript seem to work when defined in the Nested Server Control

BK