Share via


Design

The safe script manager is implemented as an ASP.NET control. Its start up logic checks for the presence of the ScriptManager control and adds the control if it is not already present on the page. This is shown in the following code.

protected override void CreateChildControls()
{
  this.scriptManager = ScriptManager.GetCurrent(this.Page);
  if (this.ScriptManager == null)
  {
     this.scriptManager = CreateScriptManager();
     this.Controls.Add(this.scriptManager);
   }

   base.CreateChildControls();
} 

If the EnableUpdatePanelSupport property is set to true, this control emits some JavaScript code that allows you to use the ASP.NET UpdatePanel control in SharePoint.

Home page on MSDN | Community site