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 為空(由設計主機拋出)。
備註
初始化物件的語句時,請使用或ClientScriptItemtext參數(不要同時使用source)。 使用 text 包含語句的輸入字串初始化腳本。 或者,使用 使用 source 包含腳本語句的路徑初始化腳本。
你可以指定任何輸入參數為 null 或 空字串(“”);對應的屬性是用輸入值設定的,而 script 該元素則是在沒有該屬性的情況下產生的。 使用 null 或 空字串(“”)會產生以下結果:
對於
text,對應script元素不包含腳本語句。對於
source,屬性src並未設定在元素script中。對於
language,屬性language並未設定在元素script中。當用戶端腳本區塊未指定腳本語言時,用戶端瀏覽器會決定該語言。
對於
type,屬性type並未設定在腳本元素中。當用戶端腳本區塊未指定腳本類型時,客戶端瀏覽器會決定該類型。
對於
id,設計主機(例如 Visual Studio 2005)會拋出 ArgumentNullException。