How do I register a script with ScriptManger on partial postback?
===

I have a RadGrid within a RadAjaxPanel that has a View button that displays a user control in a jQuery popup, also within a RadAjaxPanel, that displays details of the grid record with a delete button. Clicking the delete button causes a partial postback that causes the record to be deleted and the grid to be rebound, removing the deleted record from it.

What I then need to do is run some client script to close the popup. I have tried:

    private void RiskEditor_DeleteClick( object sender, EventArgs e )
    {
	 this.grdRiskAnalysis.Rebind();
	 ScriptManager.RegisterStartupScript(this.RadAjaxPanelRiskEditor, this.RadAjaxPanelRiskEditor.GetType(), "closepopup", "delayClosePopup($j(this).closest('.ui-dialog'), 1000);", true );
    }


In this example RadAjaxPanelRiskEditor is the AjaxPanel that the User Control is in, but I have also tried registering the script with the panel that the grid is in. Neither works.

Can someone explain where I am going wrong and how to achieve this?

Thanks

Stewart