WebControlsSection.ClientScriptsLocation 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得用戶端指令碼位置。
public:
property System::String ^ ClientScriptsLocation { System::String ^ get(); };
[System.Configuration.ConfigurationProperty("clientScriptsLocation", DefaultValue="/aspnet_client/{0}/{1}/", IsRequired=true)]
[System.Configuration.StringValidator(MinLength=1)]
public string ClientScriptsLocation { get; }
[<System.Configuration.ConfigurationProperty("clientScriptsLocation", DefaultValue="/aspnet_client/{0}/{1}/", IsRequired=true)>]
[<System.Configuration.StringValidator(MinLength=1)>]
member this.ClientScriptsLocation : string
Public ReadOnly Property ClientScriptsLocation As String
屬性值
用戶端指令碼的位置。
- 屬性
範例
下列程式代碼範例示範如何取得 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);
' Get the Web application configuration.
Dim configuration _
As System.Configuration.Configuration = _
WebConfigurationManager.OpenWebConfiguration( _
"/aspnetTest")
' Get the <webControls> section.
Dim webControlsSection _
As WebControlsSection = _
CType(configuration.GetSection( _
"system.web/webControls"), WebControlsSection)
' Read the client script location.
Dim clientScriptLocation As String = _
webControlsSection.ClientScriptsLocation
Dim msg As String = _
String.Format( _
"Client script location: {0}" + _
ControlChars.Lf, clientScriptLocation)
Console.Write(msg)
備註
如需用戶端文本及其使用的詳細資訊,請參閱 ASP.NET 網頁中的用戶端腳本。