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

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

HtmlInputButton コンストラクタ (String)

ボタンの種類指定して、HtmlInputButton クラス新しインスタンス初期化します。

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

public HtmlInputButton (
    string type
)
public:
HtmlInputButton (
    String^ type
)
public HtmlInputButton (
    String type
)
public function HtmlInputButton (
    type : String
)

パラメータ

type

入力ボタンの種類

解説解説
使用例使用例

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

<%@ 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 HtmlInputButton control as a Submit button. 
    Dim button As HtmlInputButton = New
 HtmlInputButton("submit")
    button.ID = "SubmitButton"
    button.Value = "Submit"

    ' Create a new HtmlInputButton control as a Reset button.
    Dim button2 As HtmlInputButton = New
 HtmlInputButton("reset")
    button2.ID = "ResetButton"
    button2.Value = "Reset"

    ' Add the controls to the Controls collection of the
    ' PlaceHolder control. 
    Place.Controls.Clear()
    Place.Controls.Add(button)
    Place.Controls.Add(button2)

  End Sub

</script>

<html  >
<head id="Head1" runat="server">
    <title>HtmlInputButton Constructor Example</title>
</head>
<body>
   <form runat="server">
      <h3> HtmlInputButton Constructor Example </h3>

      <asp:Placeholder id="Place" 
           runat="server"/>

   </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 HtmlInputButton control as a Submit button.
    HtmlInputButton button = new HtmlInputButton("submit");
    button.ID = "SubmitButton";
    button.Value = "Submit";

    // Create a new HtmlInputButton control as a Reset button.
    HtmlInputButton button2 = new HtmlInputButton("reset");
    button2.ID = "ResetButton";
    button2.Value = "Reset";

    // Add the controls to the Controls collection of the
    // PlaceHolder control.
    Place.Controls.Clear();
    Place.Controls.Add(button);
    Place.Controls.Add(button2);

  }

</script>
<html  >
<head runat="server">
    <title>HtmlInputButton Constructor Example</title>
</head>
<body>
   <form runat="server">
      <h3> HtmlInputButton Constructor Example </h3>

      <asp:Placeholder id="Place" 
           runat="server"/>

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

HtmlInputButton コンストラクタ

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

参照参照

関連項目

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

その他の技術情報

HTML サーバー コントロール

HtmlInputButton コンストラクタ ()

既定値使用して HtmlInputButton クラス新しインスタンス初期化します。

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

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

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

<%@ 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 HtmlInputButton control.
    Dim button As HtmlInputButton = New
 HtmlInputButton()
    button.Value = "Click Me"
    button.Attributes.Add("onclick", "alert('Hello
 from the client side.')")

    ' Add the control to the Controls collection of the
    ' PlaceHolder control. 
    Place.Controls.Clear()
    Place.Controls.Add(button)

  End Sub

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

      <asp:Placeholder id="Place" 
           runat="server"/>

   </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 HtmlInputButton control.
         HtmlInputButton button = new HtmlInputButton();
         button.Value="Click Me";
         button.Attributes.Add("onclick", "alert('Hello from the client
 side.')");

         // Add the control to the Controls collection of the
         // PlaceHolder control. 
         Place.Controls.Clear();
         Place.Controls.Add(button);

      }

</script>
<html  >
<head runat="server">
    <title>HtmlInputButton Constructor Example</title>
</head>
<body>
   <form runat="server">
      <h3> HtmlInputButton Constructor Example </h3>

      <asp:Placeholder id="Place" 
           runat="server"/>

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



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

辞書ショートカット

すべての辞書の索引

「HtmlInputButton コンストラクタ」の関連用語

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

   

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



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

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

©2025 GRAS Group, Inc.RSS