ClientScriptItem(String, String, String, String, String) 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
使用提供的参数初始化类的新实例 ClientScriptItem 。
public:
ClientScriptItem(System::String ^ text, System::String ^ source, System::String ^ language, System::String ^ type, System::String ^ id);
public ClientScriptItem(string text, string source, string language, string type, string id);
new System.Web.UI.Design.ClientScriptItem : string * string * string * string * string -> System.Web.UI.Design.ClientScriptItem
Public Sub New (text As String, source As String, language As String, type As String, id As String)
参数
- text
- String
元素的内容 script ;在客户端上运行的脚本语句字符串。
- source
- String
元素 src 的 script 属性值,指定客户端脚本内容的外部源位置。
- language
- String
元素 language 的属性值 script ,指定脚本语句的语言。
- type
- String
元素的类型属性值 script ,指示关联的脚本引擎的 MIME 类型。
- id
- String
元素的 script ID。 设计主机需要此参数(例如,Visual Studio 2005)。
例外
id 为 null(由设计主机引发)。
注解
使用ClientScriptItem或text参数(而非两者)初始化对象的语句source。 用于 text 使用包含语句的输入字符串初始化脚本。 或者,用于 source 使用包含脚本语句的路径初始化脚本。
可以将任何输入参数指定为 null 或空字符串(“”);使用输入值设置相应的属性,并且 script 该元素在没有该属性的情况下生成。 使用 null 或空字符串 (“”) 生成以下结果:
对于
text,相应的script元素不包含脚本语句。对于
source,src该属性未在元素中script设置。对于
language,language该属性未在元素中script设置。当客户端脚本块未指定脚本语言时,客户端浏览器将确定该语言。
对于
type,type该属性未在脚本元素中设置。当客户端脚本块未指定脚本类型时,客户端浏览器将确定类型。
对于
id,设计主机(例如,Visual Studio 2005)将引发 ArgumentNullException。