ScriptManager.ScriptPath Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Note: This API is now obsolete.

Gets or sets the root path of the location that is used to build the paths to ASP.NET Ajax and custom script files.

Namespace:   System.Web.UI
Assembly:  System.Web.Extensions (in System.Web.Extensions.dll)

[ObsoleteAttribute("This property is obsolete. Set the Path property on each individual ScriptReference instead.")]
public string ScriptPath { get; set; }

Property Value

Type: System.String

The location where script files are stored. The default value is an empty string (""), which is interpreted as a relative path.

The ScriptPath property enables you to specify an absolute, relative, or application-relative URL for all script blocks on the page. This includes custom and third-party script blocks that are registered with the current ScriptManager instance. The ScriptPath property is typically set declaratively as an attribute of a ScriptManager element on the page, but it can be set in code also.

If the path attribute or the Path property is set for a ScriptReference object in the Scripts collection, the path value overrides the ScriptPath value for that ScriptReference instance.

If no Path value is specified, the ScriptManager control searches the directory that is defined by the ScriptPath property and resolves script references by their Name or Assembly properties.

.NET Framework
Available since 3.5
Return to top