ScriptManager.RegisterExpandoAttribute メソッド

定義

指定したコントロールのカスタム (expando) 属性として、 ScriptManager コントロールに名前と値のペアを登録します。

public:
 static void RegisterExpandoAttribute(System::Web::UI::Control ^ control, System::String ^ controlId, System::String ^ attributeName, System::String ^ attributeValue, bool encode);
public static void RegisterExpandoAttribute(System.Web.UI.Control control, string controlId, string attributeName, string attributeValue, bool encode);
static member RegisterExpandoAttribute : System.Web.UI.Control * string * string * string * bool -> unit
Public Shared Sub RegisterExpandoAttribute (control As Control, controlId As String, attributeName As String, attributeValue As String, encode As Boolean)

パラメーター

control
Control

expando 属性を登録しているコントロール。

controlId
String

ページ上のカスタム属性を含むコントロール。

attributeName
String

登録するカスタム属性の名前。

attributeValue
String

カスタム属性の値。

encode
Boolean

true 登録されているカスタム属性をエンコードする場合。それ以外の場合は false

例外

controlnullです。

control がページのコントロール ツリーにありません。

-または-

controlIdnullです。

-または-

controlId が空です。

-または-

attributeNamenullです。

-または-

attributeName が空です。

-または-

attributeName は既に登録されています。

注釈

RegisterExpandoAttribute メソッドを使用して、部分ページ レンダリングと互換性があり、Microsoft Ajax ライブラリの依存関係がないコントロールのカスタム (expando) プロパティを登録します。

RegisterExpandoAttribute メソッドは、名前と値のペアを、指定したコントロールのカスタム属性として登録します。 プロパティは ECMAScript (JavaScript) から動的に設定され、レンダリングされたコントロールのマークアップに対する XHTML の互換性が維持されます。 動的プロパティの値内の文字をエスケープする必要がある場合は、 encodetrue に設定します。

動的プロパティを追加するコントロールが見つからない場合は、スクリプト エラーが発生します。

適用対象

こちらもご覧ください