5 out of 6 rated this helpful - Rate this topic

ScriptReferenceBase Class

The base class for all script reference classes.

Namespace:  System.Web.UI
Assembly:  System.Web.Extensions (in System.Web.Extensions.dll)
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public abstract class ScriptReferenceBase
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5 SP1
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
A problem in my website
$0 $0Hi,$0 $0Sorry for taking your time, I found you in ASP.net forums and felt you can help me about my problem.$0 $0Actually when I use "ToolkitScriptManager" I receive the error of:$0 $0Could not load type 'System.Web.UI.ScriptReferenceBase' from assembly 'System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'$0 $0 and when I use regular "ScriptManager" I receive the error of:$0 $0AjaxControlToolkit requires ASP.NET ajax 4.0 scripts. Ensure the correct version of the scripts are referenced. if you are using ScriptManager switch to the ToolkitScriptManager in AjaxControlToolkit.dll.$0 $0And when I upload my website with this configuration my ajax controls don't work!$0 $0I am working with visual studio 2008 SP1, I re-installed both visual studio and its service pack and got no positive result! Actually, I tried all the suggested solutions in this website but it was not solved!$0 $0Would you please help me? I'll be more than thankful!$0 $0Regards,$0 $0M.R.Amiri$0 $0amirikhorheh@hotmail.com$0 $0
Could not load type 'System.Web.UI.ScriptReferenceBase' from assembly 'System.Web.Extensions,...
Just wanted to add to RandolphoAtKroll's contribution to say that if you are getting this when trying to use the Ajax Control Toolkit then a quick fix for this problem (or for people who don't have the option of installing SP1) is to simply change your <cc1:ToolkitScriptManager> references to <asp:ScriptManager> ones.

The main benefit to using the ToolkitScriptManager over the basic ScriptManager is that it has script combining support to reduce the amount of round trips visitors will have to make to download the supporting JavaScript files.

Its not as efficient but its a lot better than having a broken site :)
New Class and Hidden Gotcha! for .NET 3.5 Service Pack 1
If you are researching this class because you received the following exception:
Could not load type 'System.Web.UI.ScriptReferenceBase' from assembly 'System.Web.Extensions, Version=3.5.0.0, 
Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

It's highly likely that you compiled your code using .NET 3.5 Service Pack 1 but deployed to a system that has .NET 3.5 without Service Pack 1.

ScriptReferenceBase is a new class for Service Pack 1, clearly a refactoring of ScriptReference to allow common code for the new CompositeScriptReference class. If you compile your code using SP1, you will include a reference to this class, which does not exist in .NET 3.5 pre-SP1. When the non-SP1 runtime tries to load the class, you will receive the exception above.

Solutions are:

  • Compile using .NET 3.5 without SP1.
    --OR--
  • Install SP1 on the target system