ControlDesigner.GetEmptyDesignTimeHtml メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > ControlDesigner.GetEmptyDesignTimeHtml メソッドの意味・解説 

ControlDesigner.GetEmptyDesignTimeHtml メソッド

実行時にビジュアルな表示が存在しない Web サーバー コントロールをデザイン時に表すための HTML マークアップを取得します。

名前空間: System.Web.UI.Design
アセンブリ: System.Design (system.design.dll 内)
構文構文

Protected Overridable Function
 GetEmptyDesignTimeHtml As String
Dim returnValue As String

returnValue = Me.GetEmptyDesignTimeHtml
protected virtual string GetEmptyDesignTimeHtml
 ()
protected:
virtual String^ GetEmptyDesignTimeHtml ()
protected String GetEmptyDesignTimeHtml ()
protected function GetEmptyDesignTimeHtml ()
 : String

戻り値
他にビジュアルな表示が存在しないコントロールをデザイン時に表すために使用する HTML マークアップ。既定値は、コンポーネントの種類と ID を含んでいる四角形です。

解説解説

GetEmptyDesignTimeHtml メソッドの既定の動作では、コンポーネント名を含んでいる文字列を返します。デザイン時 HTML マークアップが存在しない場合は、GetDesignTimeHtml メソッドの実装で GetEmptyDesignTimeHtml メソッドを呼び出す必要があります。

使用例使用例

カスタム コントロール デザイナで GetDesignTimeHtml メソッドをオーバーライドする方法を次のコード例に示します。関連付けられているコントロールの Text プロパティが空の場合、GetDesignTimeHtml メソッドは GetEmptyDesignTimeHtml メソッドを呼び出します。それ以外の場合、GetDesignTimeHtml メソッドは Hyperlink コントロールを作成および表示します。

Public Overrides Function
 GetDesignTimeHtml() As String
   ' Component is the instance of the component or control that
   ' this designer object is associated with. This property is 
   ' inherited from System.ComponentModel.ComponentDesigner.
   simpleControl = CType(Component, Simple)
   
   If simpleControl.Text.Length > 0 Then
      Dim sw As New StringWriter()
      Dim tw As New HtmlTextWriter(sw)
      
      Dim placeholderLink As New
 HyperLink()
      
      ' Put simpleControl.Text into the link's Text.
      placeholderLink.Text = simpleControl.Text
      placeholderLink.NavigateUrl = simpleControl.Text
      placeholderLink.RenderControl(tw)
      
      Return sw.ToString()
   Else
      Return GetEmptyDesignTimeHtml()
   End If
End Function
public override string GetDesignTimeHtml()
{
    if (simpleControl.Text.Length > 0)
    {
        string spec = "<a href='{0}.aspx'>{0}</a>";
        return String.Format(spec, simpleControl.Text);
    }
    else
        return GetEmptyDesignTimeHtml();
}
.NET Framework のセキュリティ.NET Framework のセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ControlDesigner クラス
ControlDesigner メンバ
System.Web.UI.Design 名前空間
GetErrorDesignTimeHtml
GetDesignTimeHtml
その他の技術情報
Web フォームのデザイン時サポート


このページでは「.NET Framework クラス ライブラリ リファレンス」からControlDesigner.GetEmptyDesignTimeHtml メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からControlDesigner.GetEmptyDesignTimeHtml メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からControlDesigner.GetEmptyDesignTimeHtml メソッド を検索

英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

ControlDesigner.GetEmptyDesignTimeHtml メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



ControlDesigner.GetEmptyDesignTimeHtml メソッドのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS