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

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

Control.IsLiteralContent メソッド

サーバー コントロールリテラル内容だけを保持しているかどうか決定します

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

protected bool IsLiteralContent ()
protected:
bool IsLiteralContent ()
protected boolean IsLiteralContent ()
protected function IsLiteralContent () : boolean

戻り値
サーバー コントロールリテラル内容だけを含む場合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.");
                }
        }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
Control クラス
Control メンバ
System.Web.UI 名前空間
HasControls
LiteralControl



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

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

   

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



Control.IsLiteralContent メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS