WebControlsSection.ClientScriptsLocation Property

 

Gets the client scripts location.

Namespace:   System.Web.Configuration
Assembly:  System.Web (in System.Web.dll)

[ConfigurationPropertyAttribute("clientScriptsLocation", IsRequired = true, 
	DefaultValue = "/aspnet_client/{0}/{1}/")]
[StringValidatorAttribute(MinLength = 1)]
public string ClientScriptsLocation { get; }

Property Value

Type: System.String

The location of the client scripts.

For details about the client scripts and their use, refer to Client Script in ASP.NET Web Pages.

The following code example shows how to obtain the ClientScriptsLocation.


// Get the Web application configuration.
System.Configuration.Configuration configuration =
    WebConfigurationManager.OpenWebConfiguration(
    "/aspnetTest");

// Get the <webControls> section.
WebControlsSection webControlsSection =
  (WebControlsSection)configuration.GetSection(
  "system.web/webControls");

// Read the client script location.
string clientScriptLocation =
    webControlsSection.ClientScriptsLocation;

string msg = String.Format(
"Client script location: {0}\n",
clientScriptLocation);

Console.Write(msg);

.NET Framework
Available since 2.0
Return to top
Show: