Control.IsLiteralContent メソッド
アセンブリ: System.Web (system.web.dll 内)

Dim returnValue As Boolean returnValue = Me.IsLiteralContent
サーバー コントロールがリテラルな内容だけを含む場合は true。それ以外の場合は false。


サーバー コントロールを含むページがポストバックされたかどうかをチェックするコード例を次に示します。ポストバックされている場合、このコードは IsLiteralContent メソッドを呼び出して、コントロールがリテラル コンテンツだけを含んでいるか、それとも他のサーバー コントロールの親コントロールになっているかをチェックします。リテラル コンテンツだけを含んでいる場合は、そのコンテンツを表す LiteralControl の UniqueID プロパティが応答に書き込まれます。
' Override the OnLoad method to check if the ' page that uses this control has posted back. ' If so, check whether this controls contains ' only literal content, and if it does, ' it gets the UniqueID property and writes it ' to the page. Otherwise, it writes a message ' that the control contains more than literal content. Overrides Protected Sub OnLoad(ByVal e As EventArgs) If Page.IsPostBack = True Then Dim s As String If Me.IsLiteralContent() = True Then s = Controls(0).UniqueID Context.Response.Write(s) Else Context.Response.Write( _ "The control contains more than literal content.") End If End If End Sub
// Override the OnLoad method to check if the // page that uses this control has posted back. // If so, check whether this controls contains // only literal content, and if it does, // it gets the UniqueID property and writes it // to the page. Otherwise, it writes a message // that the control contains more than literal content. protected override void OnLoad(EventArgs e) { if (Page.IsPostBack) { String s; if (this.IsLiteralContent()) { s = Controls[0].UniqueID; Context.Response.Write(s); } else { Context.Response.Write( "The control contains more than literal content."); } } }

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


Weblioに収録されているすべての辞書からControl.IsLiteralContent メソッドを検索する場合は、下記のリンクをクリックしてください。

- Control.IsLiteralContent メソッドのページへのリンク