LoginViewDesigner.GetEmptyDesignTimeHtml メソッド
メモ : このメソッドは、.NET Framework version 2.0 で新しく追加されたものです。
現在のテンプレートが定義されていない場合に、関連付けられたコントロールのプレースホルダをデザイン時表示するためのマークアップを取得します。
名前空間: System.Web.UI.Design.WebControls
アセンブリ: System.Design (system.design.dll 内)
構文
Dim returnValue As String returnValue = Me.GetEmptyDesignTimeHtml

GetEmptyDesignTimeHtml メソッドは、最初に、関連付けられた LoginView コントロールの現在のテンプレートの名前を指定する文字列メッセージに書式を設定します。また、テンプレートが空であることも指定します。次に、GetEmptyDesignTimeHtml は、そのメッセージを含んだプレースホルダのマークアップを生成します。

LoginViewDesigner クラスから継承したクラスで GetEmptyDesignTimeHtml メソッドをオーバーライドすることにより、デザイン時に、LoginView クラスから派生したコントロールの外観を変更するコード例を次に示します。この例では、関連付けられたコントロールに定義されているすべての RoleGroup オブジェクトの名前を含んだプレースホルダのマークアップを生成します。
' Generate the design-time markup for the control ' when the template is empty. Protected Overrides Function GetEmptyDesignTimeHtml() As String ' Generate a design-time placeholder containing the names of all ' the role groups. Dim myLoginViewCtl As MyLoginView = CType(ViewControl, MyLoginView) Dim roleGroups As RoleGroupCollection = myLoginViewCtl.RoleGroups Dim RoleNames As String = Nothing Dim rgX As Integer ' If there are any role groups, form a string of their names. If roleGroups.Count > 0 Then roleNames = "Role Groups: <br /> " & _ roleGroups(0).ToString() For rgX = 1 To roleGroups.Count - 1 roleNames &= "<br /> " & _ roleGroups(rgX).ToString() Next rgX End If Return CreatePlaceHolderDesignTimeHtml(roleNames) End Function ' GetEmptyDesignTimeHtml
// Generate the design-time markup for the control // when the template is empty. protected override string GetEmptyDesignTimeHtml() { // Generate a design-time placeholder containing the names of all // the role groups. MyLoginView myLoginViewCtl = (MyLoginView)ViewControl; RoleGroupCollection roleGroups = myLoginViewCtl.RoleGroups; string roleNames = null; // If there are any role groups, form a string of their names. if (roleGroups.Count > 0) { roleNames = "Role Groups: <br /> " + roleGroups[0].ToString(); for( int rgX = 1; rgX < roleGroups.Count; rgX++ ) roleNames += "<br /> " + roleGroups[rgX].ToString(); } return CreatePlaceHolderDesignTimeHtml( roleNames); } // GetEmptyDesignTimeHtml


Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- LoginViewDesigner.GetEmptyDesignTimeHtml メソッドのページへのリンク