LiteralControl コンストラクタ

名前 | 説明 |
---|---|
LiteralControl () | 要求された ASP.NET ページに表示されるリテラル文字列を格納している LiteralControl クラスの新しいインスタンスを初期化します。 |
LiteralControl (String) | テキストを指定して、LiteralControl クラスの新しいインスタンスを初期化します。 |

LiteralControl コンストラクタ (String)
アセンブリ: System.Web (system.web.dll 内)


LiteralControl コンストラクタを使用して、LiteralControl クラスの 2 つのインスタンスを作成するコード例を次に示します。2 つのインスタンスは、H3 HTML 要素の開始タグと終了タグをレンダリングし、H3 タグ内に表示されるテキストを挿入します。
' Add two LiteralControls that render HTML H3 elements and text. <System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.Demand, Name:="FullTrust")> _ Protected Overrides Sub CreateChildControls() Me.Controls.Add(New LiteralControl("<h3>Value: ")) Dim Box As New TextBox Box.Text = "0" Me.Controls.Add(box) Me.Controls.Add(New LiteralControl("</h3>")) End Sub
// Add two LiteralControls that render HTML H3 elements and text. [System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name="FullTrust")] protected override void CreateChildControls() { this.Controls.Add(new LiteralControl("<h3>Value: ")); TextBox box = new TextBox(); box.Text = "0"; this.Controls.Add(box); this.Controls.Add(new LiteralControl("</h3>")); }
// Add two LiteralControls that render HTML H3 elements and text. protected void CreateChildControls() { this.get_Controls().Add(new LiteralControl("<h3>Value: ")); TextBox box = new TextBox(); box.set_Text("0"); this.get_Controls().Add(box); this.get_Controls().Add(new LiteralControl("</h3>")); } //CreateChildControls

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


LiteralControl コンストラクタ ()
アセンブリ: System.Web (system.web.dll 内)


LiteralControl クラスを拡張するための CustLiteralControlClass を作成するコード例を次に示します。この例では、LiteralControl オブジェクトのテキストを指定しないコンストラクタを使用して、myLiteralControlClass1 という名前のクラスのインスタンスを作成しています。オブジェクトの作成後、Text プロパティを使用して格納されているテキストを設定します。

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- LiteralControl コンストラクタのページへのリンク