コントロールについてわかりやすい表示をするための十分な情報がない場合は、デザイン時に、コントロールの関連情報を表示するために使用できるコントロール用の単純な HTML セクションを指定された追加情報を使用して作成します。
Overloads Protected Function CreatePlaceHolderDesignTimeHtml( _
ByVal instruction As String _) As String
[C#]
protected string CreatePlaceHolderDesignTimeHtml(stringinstruction);
[C++]
protected: String* CreatePlaceHolderDesignTimeHtml(String* instruction);
[JScript]
protected function CreatePlaceHolderDesignTimeHtml(
instruction : String) : String;
パラメータ
- instruction
HTML セクションに追加する情報が含まれている文字列。
戻り値
コントロールに関する情報を提供するデザイン時 HTML が含まれている文字列。
解説
このメソッドは、デザイン時に空のコントロールで表示できる、標準プレースホルダのスタイルの HTML を含む文字列を返し、コントロールに関する基本情報を提供します。返される文字列には、コントロールの型および ID が含まれます。
実装時の注意: このメソッドを GetDesignTimeHtml から呼び出して、プレースホルダ情報を提供できます。
使用例
[Visual Basic] テンプレート宣言されたコントロール デザイナの GetEmptyDesignTimeHtml メソッドをオーバーライドするコード例を次に示します。このコードは、 TemplatedControlDesigner.CanEnterTemplateMode プロパティの値を調べ、その結果に応じて、文字列変数に設定する値を 2 つの選択肢から選びます。結果として得られる文字列は、 CreatePlaceHolderDesignTimeHtml メソッドの呼び出し時に instruction パラメータに渡されます。
' Override the GetEmptyDesignTimeHtml to check whether
' template mode can be used from the designer, and provide
' display messages for both cases.
Protected Overrides Function GetEmptyDesignTimeHtml() As String
Dim textValue As String
If CanEnterTemplateMode Then
textValue = "Right click and choose a set of templates to edit their content.<br>The ItemTemplate is required."
Else
textValue = "Switch to HTML view to edit the control's templates.<br>The ItemTemplate is required."
End If
Return CreatePlaceHolderDesignTimeHtml(textValue)
End Function
[C#, C++, JScript] C#、C++、および JScript のサンプルはありません。Visual Basic のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン をクリックします。
必要条件
プラットフォーム: Windows 2000, Windows XP Professional, Windows Server 2003 ファミリ
.NET Framework セキュリティ:
- 直前の呼び出し元の完全信頼。このメンバは、部分的に信頼されているコードから使用することはできません。詳細の参照先 : 部分信頼コードからのライブラリの使用
参照
ControlDesigner クラス | ControlDesigner メンバ | System.Web.UI.Design 名前空間 | ControlDesigner.CreatePlaceHolderDesignTimeHtml オーバーロードの一覧