HtmlGenericControl コンストラクタ ()とは? わかりやすく解説

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

HtmlGenericControl コンストラクタ ()

HtmlGenericControl クラス新しインスタンス既定値初期化します。

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

Dim instance As New HtmlGenericControl
public HtmlGenericControl ()
public:
HtmlGenericControl ()
public HtmlGenericControl ()
public function HtmlGenericControl ()
解説解説
使用例使用例

既定コンストラクタ使用してHtmlGenericControl クラス新しインスタンス作成する方法次のコード例示します

<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML
 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
  Sub Page_Load(ByVal sender As
 Object, ByVal e As EventArgs)

    ' Create a new HtmlGenericControl.
    Dim NewControl As New
 HtmlGenericControl()

    ' Set the properties of the new HtmlGenericControl control.
    NewControl.ID = "NewControl"
    NewControl.InnerHtml = "This is a dynamically created HTML
 server control."

    ' Add the new HtmlGenericControl to the Controls collection of the
    ' PlaceHolder control. 
    ControlContainer.Controls.Add(NewControl)

  End Sub

</script>
<html  >
<head runat="server">
  <title>HtmlGenericControl Constructor Example</title>
</head>
<body>

   <form runat="server">
   <div>

      <h3> HtmlGenericControl Constructor Example </h3>

      <asp:PlaceHolder ID="ControlContainer"
                       runat="server"/>
   </div>
   </form>

</body>
</html>
<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
  void Page_Load(Object sender, EventArgs e)
  {

    // Create a new HtmlGenericControl.
    HtmlGenericControl NewControl = new HtmlGenericControl();

    // Set the properties of the new HtmlGenericControl control.
    NewControl.ID = "NewControl";
    NewControl.InnerHtml = "This is a dynamically created HTML server control.";

    // Add the new HtmlGenericControl to the Controls collection of
 the
    // PlaceHolder control. 
    ControlContainer.Controls.Add(NewControl);

  }

</script>
<html  >
<head id="Head1" runat="server">
  <title>HtmlGenericControl Constructor Example</title>
</head>
<body>

   <form runat="server">
   <div>

      <h3> HtmlGenericControl Constructor Example </h3>

      <asp:PlaceHolder ID="ControlContainer"
                       runat="server"/>
   </div>
   </form>

</body>
</html>
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

HtmlGenericControl コンストラクタ (String)

タグ指定して、HtmlGenericControl クラス新しインスタンス初期化します。

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

Dim tag As String

Dim instance As New HtmlGenericControl(tag)
public HtmlGenericControl (
    string tag
)
public:
HtmlGenericControl (
    String^ tag
)
public HtmlGenericControl (
    String tag
)
public function HtmlGenericControl (
    tag : String
)

パラメータ

tag

クラスのこのインスタンス作成するための要素の名前。

解説解説
使用例使用例

オーバーロードされたコンストラクタ使用してHtmlGenericControl クラス新しインスタンス作成する方法次のコード例示します

<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML
 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

  Sub Page_Load(ByVal sender As
 Object, ByVal e As EventArgs)

    ' Create a new HtmlGenericControl.
    Dim NewControl As New
 HtmlGenericControl("div")

    ' Set the properties of the new HtmlGenericControl control.
    NewControl.ID = "NewControl"
    NewControl.InnerHtml = "This is a dynamically created HTML
 server control."

    ' Add the new HtmlGenericControl to the Controls collection of the
    ' PlaceHolder control. 
    ControlContainer.Controls.Add(NewControl)

  End Sub

</script>
<html  >
<head runat="server">
  <title>HtmlGenericControl Constructor Example</title>
</head>
<body>

   <form runat="server">
   <div>

      <h3> HtmlGenericControl Constructor Example </h3>

      <asp:PlaceHolder ID="ControlContainer"
                       runat="server"/>
   </div>
   </form>

</body>
</html>
<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
  
  void Page_Load(Object sender, EventArgs e)
  {
    // Create a new HtmlGenericControl.
    HtmlGenericControl NewControl = new HtmlGenericControl("div");

    // Set the properties of the new HtmlGenericControl control.
    NewControl.ID = "NewControl";
    NewControl.InnerHtml = "This is a dynamically created HTML server control.";

    // Add the new HtmlGenericControl to the Controls collection of
 the
    // PlaceHolder control. 
    ControlContainer.Controls.Add(NewControl);

  }
</script>

<html  >
<head runat="server">
  <title>HtmlGenericControl Constructor Example</title>
</head>
<body>

   <form runat="server">
   <div>

      <h3> HtmlGenericControl Constructor Example </h3>

      <asp:PlaceHolder ID="ControlContainer"
                       runat="server"/>
   </div>
   </form>

</body>
</html>
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

HtmlGenericControl コンストラクタ

HtmlGenericControl クラス新しインスタンス初期化します。
オーバーロードの一覧オーバーロードの一覧

名前 説明
HtmlGenericControl () HtmlGenericControl クラス新しインスタンス既定値初期化します。
HtmlGenericControl (String) タグ指定してHtmlGenericControl クラス新しインスタンス初期化します。
参照参照

関連項目

HtmlGenericControl クラス
HtmlGenericControl メンバ
System.Web.UI.HtmlControls 名前空間

その他の技術情報

HTML サーバー コントロール



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

辞書ショートカット

すべての辞書の索引

「HtmlGenericControl コンストラクタ ()」の関連用語

HtmlGenericControl コンストラクタ ()のお隣キーワード
検索ランキング

   

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



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

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

©2025 GRAS Group, Inc.RSS