DataBoundLiteralControl クラスとは? わかりやすく解説

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

DataBoundLiteralControl クラス

データ バインディング式および静的リテラル テキスト保持します。このクラス継承できません。

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

Public NotInheritable Class
 DataBoundLiteralControl
    Inherits Control
    Implements ITextControl
Dim instance As DataBoundLiteralControl
public sealed class DataBoundLiteralControl
 : Control, ITextControl
public ref class DataBoundLiteralControl sealed
 : public Control, ITextControl
public final class DataBoundLiteralControl
 extends Control implements ITextControl
public final class DataBoundLiteralControl
 extends Control implements ITextControl
解説解説

DataBoundLiteralControl クラスは、Text プロパティの値をビューステート永続化ます。

使用例使用例

DataBoundLiteralControl オブジェクト取得するクラス作成し、このオブジェクトText プロパティ表示する方法次のコード例示します

Imports System
Imports System.Web
Imports System.Web.UI


Namespace Samples.AspNet.VB.Controls 
   
   Public Class MyControlVB
      Inherits Control     

      <System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.Demand,
 Name:="FullTrust")> _
      Protected Overrides Sub
 Render(Output As HtmlTextWriter)
         ' Checks if a DataBoundLiteralControl object is present.
         If HasControls() And TypeOf
 Controls(0) Is DataBoundLiteralControl Then
            

            ' Obtains the DataBoundLiteralControl instance.
            Dim boundLiteralControl As DataBoundLiteralControl
 = CType(Controls(0), DataBoundLiteralControl)
            ' Retrieves the text in the boundLiteralControl object.
            Dim text As String
 = boundLiteralControl.Text
            output.Write(("<h4>Your Message: "
 + text + "</h4>"))
         End If 
      End Sub 'Render  

   End Class 'MyControl
End Namespace 'MyUserControl
using System;
using System.Web;
using System.Web.UI;

namespace Samples.AspNet.CS.Controls 
{

   public class MyControl : Control 
   {
 
    [System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand,
 Name="FullTrust")] 
    protected override void Render(HtmlTextWriter
 output) 
    {
      // Checks if a DataBoundLiteralControl object is present.
      if ( (HasControls()) && (Controls[0] is DataBoundLiteralControl)
 ) 
      {
        // Obtains the DataBoundLiteralControl instance.
        DataBoundLiteralControl boundLiteralControl = (DataBoundLiteralControl)Controls[0];
        // Retrieves the text in the boundLiteralControl object.
        String text = boundLiteralControl.Text;
        output.Write("<h4>Your Message: " +text+"</h4>");

      }
    }
   }    
}

/*File name: myDataBoundLiteralControl.jsl */
import System.*;
import System.Web.*;
import System.Web.UI.*;

public class MyControl extends Control
{
    protected void Render(HtmlTextWriter output)
    {
        // Checks if a DataBoundLiteralControl object is present.
        if (HasControls() && get_Controls().get_Item(0)
            instanceof DataBoundLiteralControl) {
            // Obtains the DataBoundLiteralControl instance.
            DataBoundLiteralControl boundLiteralControl =
                (DataBoundLiteralControl)get_Controls().get_Item(0);
            // Retrieves the text in the boundLiteralControl object.
            String text = boundLiteralControl.get_Text();
            output.Write("<h4>Your Message: " + text + "</h4>");
        }
    } //Render 
} //MyControl
継承階層継承階層
System.Object
   System.Web.UI.Control
    System.Web.UI.DataBoundLiteralControl
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DataBoundLiteralControl メンバ
System.Web.UI 名前空間



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

辞書ショートカット

すべての辞書の索引

「DataBoundLiteralControl クラス」の関連用語

DataBoundLiteralControl クラスのお隣キーワード
検索ランキング

   

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



DataBoundLiteralControl クラスのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS