Skip to main content
Logo

Disable the script manager

Performance can be an important factor when building a website for your organisation. It affects the experience of your visitors and your ranking in search engines. Performance also has a potential impact on the budget supporting your site’s infrastructure and development.

In previous versions of Contensis, we’ve put out a number of JavaScript files on front-end sites that relate to Microsoft’s ScriptManager control (which manages client script for AJAX-enabled pages). In some cases this would equal 173Kb of unneeded JS on the page, which has an unnecessary effect on rendering performance.

In Contensis R8.3, we’ve added a setting against the CMS config of a publishing server to switch the ScriptManager off. Some of our controls however will still force the ScriptManager on on pages that they are included in because it is needed for their operation, also you may find that your own bespoke controls will not work with ScriptManager turned off, so it’s essential this change is tested on your preview servers before switching your live servers.

HTML Comparison

Script Manager Enabled

Script Manager Disabled

Configuring the publishing server

Any publishing server setup before R8.3 will have the ScriptManager enabled. We’ve disabled it by default for any publishing server setup after upgrading to R8.3.

  1. Go to the Management Console
  2. Select Project Setup
  3. Select Publishing Servers
  4. Locate your test server and Select CMS Config
  5. The CMS Config will open in a Code Editor window
  6. Find the key named Contensis_RenderScriptManager
  7. Set the value to False
  8. Press Save & Publish
  9. The CMS Config will be published removing the ScriptManager from any rendered page.

Note: When making any change to your published website, we recommend updating your test server before any live production servers.


Having updated your preview server – and confirmed that your site is working as expected – follow the procedure for any live servers.

Configure pages and controls

You may decide to set script manager rendering on or off across your server, however you may have certain pages you want to override the default, e.g. if you have some controls, that depend upon it.

In this situation, we have provided a property that can be set before the Page Init event (this is due to a Microsoft .NET limitation), if you try to set it too late, you’ll get an InvalidOperationException. This property allows you to override the server default for that page.

Control

This must be in a Control Init event, and added to the page before the page load event:

Me.ParentPage.RenderScriptManager = True

Page

This must be in a Page PreInit event:

Me.RenderScriptManager = True