派生クラスでオーバーライドされた場合は、指定されたテンプレートの内容を、指定された内容に設定します。
Public MustOverride Sub SetTemplateContent( _
ByVal editingFrame As ITemplateEditingFrame, _ ByVal templateName As String, _ ByVal templateContent As String _)
[C#]
public abstract void SetTemplateContent(ITemplateEditingFrameeditingFrame,stringtemplateName,stringtemplateContent);
[C++]
public: virtual void SetTemplateContent(ITemplateEditingFrame* editingFrame,String* templateName,String* templateContent) = 0;
[JScript]
public abstract function SetTemplateContent(
editingFrame : ITemplateEditingFrame,templateName : String,templateContent : String);
パラメータ
- editingFrame
内容を提供する対象のテンプレート編集フレーム。 - templateName
テンプレートの名前。 - templateContent
テンプレートに設定する内容。
使用例
[Visual Basic] SetTemplateContent メソッドをオーバーライドして、 templateContent パラメータに null 参照 (Visual Basic では Nothing) 値が渡されたかどうかをチェックするコード例を次に示します。 null 参照 (Nothing) 値が渡されていない場合は、 GetTemplateFromText メソッドを使用して、 templateContent パラメータの値になっているテンプレートと等価のテンプレートを設定します。
' Override the SetTemplateContent method to check whether the template
' exists. If it does, set its content to the value already created for it.
'
Public Overrides Sub SetTemplateContent( _
editingFrame As ITemplateEditingFrame, _
templateName As String, _
templateContent As String)
Debug.Assert((editingFrame.Verb.Index = 0))
Debug.Assert(templateName.Equals("ItemTemplate"))
Dim template As ITemplate = Nothing
If Not (templateContent Is Nothing) And templateContent.Length <> 0 Then
template = GetTemplateFromText(templateContent)
End If
CType(Component, TemplatedList).ItemTemplate = template
End Sub
[C#, C++, JScript] C#、C++、および JScript のサンプルはありません。Visual Basic のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン をクリックします。
必要条件
プラットフォーム: Windows 2000, Windows XP Professional, Windows Server 2003 ファミリ
.NET Framework セキュリティ:
- 直前の呼び出し元の完全信頼。このメンバは、部分的に信頼されているコードから使用することはできません。詳細の参照先 : 部分信頼コードからのライブラリの使用
参照
TemplatedControlDesigner クラス | TemplatedControlDesigner メンバ | System.Web.UI.Design 名前空間