ClientScriptItem Constructor
Initializes a new instance of the ClientScriptItem class using the provided parameters.
Assembly: System.Design (in System.Design.dll)
public:
ClientScriptItem(
String^ text,
String^ source,
String^ language,
String^ type,
String^ id
)
Parameters
- text
- Type: System::String
The contents for the script element; a string of script statements to run on the client.
- source
- Type: System::String
The src attribute value for the script element, specifying an external source location for the client script contents.
- language
- Type: System::String
The language attribute value for the script element, specifying the language of the script statements.
- type
- Type: System::String
The type attribute value for the script element, indicating the MIME type for the associated scripting engine.
- id
- Type: System::String
The ID for the script element. This argument is required by the design host (for example, Visual Studio 2005).
| Exception | Condition |
|---|---|
| ArgumentNullException | id is null (thrown by the design host). |
Initialize the statements for the ClientScriptItem object by using either the text or source parameter (not both). Use text to initialize the script using an input string that contains the statements. Alternately, use source to initialize a script using a path that contains the script statements.
You can specify any of the input parameters as nullptr or an empty string (""); the corresponding property is set using the input value, and the script element is generated without that property. Using nullptr or an empty string ("") generates the following results:
For text, the corresponding script element does not contain script statements.
For source, the src attribute is not set in the script element.
For language, the language attribute is not set in the script element.
When a client script block does not specify the script language, the client browser determines the language.
For type, the type attribute is not set in the script element.
When a client script block does not specify the script type, the client browser determines the type.
For id, the design host (for example, Visual Studio 2005) will throw an ArgumentNullException.
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
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.