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

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

HtmlInputSubmit コンストラクタ (String)

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

型を指定して、HtmlInputSubmit クラス新しインスタンス初期化します。

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

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

パラメータ

type

入力ボタンの種類

解説解説

HtmlInputSubmitインスタンス初期プロパティ値を次の表に示します

プロパティ

HtmlControl.TagName

type パラメータの値。

使用例使用例

Web フォーム ページに HtmlInputText、HtmlInputPassword、および HtmlInputSubmit の各コントロールプログラムか追加し単純なログイン画面作成する方法次のコード例示します。この例では、組み込みHTML コントロールタイプオーバーライドする type パラメータさまざまな値を渡す方法示します

<%@ 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">
  Protected Sub Page_Load(ByVal
 sender As Object, ByVal
 e As EventArgs)
    
    If (IsPostBack) Then
      ' Add code to process the Login.
    End If

  End Sub

  Protected Sub Page_Init(ByVal
 sender As Object, ByVal
 e As System.EventArgs)

    ' Pass "password" to make the HtmlInput control render
 a
    ' password input type.
    Dim passwordText As HtmlInputPassword =
 New HtmlInputPassword()
    passwordText.MaxLength = 20
    Placeholder1.Controls.Add(passwordText)

    ' Pass "submit" to make the HtmlInput control render a
    ' form submit button.
    Dim submitButton As HtmlInputSubmit = New
 HtmlInputSubmit("submit")
    submitButton.Value = "Log On to System"
    Placeholder2.Controls.Add(submitButton)
    
  End Sub
</script>

<html  >
  <body>
    <form id="Form1" runat="server">

      <table cellpadding="2">
        <tr>
        <td>Password
            <asp:placeholder
                runat="server"
                id="Placeholder1" />
        </td></tr>
        <tr><td><asp:placeholder
                runat="server"
                id="Placeholder2" />
        </td></tr>
      </table>
    </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">
  protected void page_load(object sender, EventArgs
 e)
  {
    if (IsPostBack)
    {
      // Add code to process the Login.
    }

  }

  protected void Page_Init(object sender, EventArgs
 e)
  {

    // Pass "password" to make the HtmlInput control render
 a
    // password input type.
    HtmlInputPassword passwordText = new HtmlInputPassword();
    passwordText.MaxLength = 20;
    Placeholder1.Controls.Add(passwordText);

    // Pass "submit" to make the HtmlInput control render
 a
    // form submit button.
    HtmlInputSubmit submitButton = new HtmlInputSubmit("submit");
    submitButton.Value = "Log On to System";
    Placeholder2.Controls.Add(submitButton);

  }
</script>

<html  >
  <body>
    <form id="Form1" runat="server">

      <table cellpadding="2">
        <tr>
        <td>Password
            <asp:placeholder
                runat="server"
                id="Placeholder1" />
        </td></tr>
        <tr><td><asp:placeholder
                runat="server"
                id="Placeholder2" />
        </td></tr>
      </table>
    </form>
  </body>
</html>
<%@ Page Language="VJ#" %>

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

<script runat="server">
  protected void Page_Load(Object sender, System.EventArgs
 e)
  {
    if (get_IsPostBack())
    {
      // Add code to process the Login.
    }
  }

  protected void Page_Init(Object sender, EventArgs
 e)
  {
    // Pass "password" to make the HtmlInput control render
 a
    // password input type.
    HtmlInputPassword passwordText = new HtmlInputPassword();
    passwordText.set_MaxLength(20);
    Placeholder1.get_Controls().Add(passwordText);

    // Pass "submit" to make the HtmlInput control render
 a
    // form submit button.
    HtmlInputSubmit submitButton = new HtmlInputSubmit("submit");
    submitButton.set_Value("Log On to System");
    Placeholder2.get_Controls().Add(submitButton);
    
  }
</script>

<html  >
  <body>
    <form id="Form1" runat="server">

      <table cellpadding="2">
        <tr>
        <td>Password
            <asp:placeholder
                runat="server"
                id="Placeholder1" />
        </td></tr>
        <tr><td><asp:placeholder
                runat="server"
                id="Placeholder2" />
        </td></tr>
      </table>
    </form>
  </body>
</html>
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
HtmlInputSubmit クラス
HtmlInputSubmit メンバ
System.Web.UI.HtmlControls 名前空間

HtmlInputSubmit コンストラクタ

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

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

関連項目

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

HtmlInputSubmit コンストラクタ ()

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

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

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

Dim instance As New HtmlInputSubmit
public HtmlInputSubmit ()
public:
HtmlInputSubmit ()
public HtmlInputSubmit ()
public function HtmlInputSubmit ()
解説解説

HtmlInputSubmitインスタンス初期プロパティ値を次の表に示します

プロパティ

HtmlControl.TagName

"submit" リテラル文字列

使用例使用例

既定コンストラクタ使用して Web フォーム ページに HtmlInputText、HtmlInputPassword、および HtmlInputSubmit の各コントロールプログラムか追加し簡単なログイン画面作成する方法次のコード例示します

<%@ 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">

  Protected Sub Page_Load(ByVal
 sender As Object, ByVal
 e As EventArgs)
    
    If (IsPostBack) Then
      ' Add code to process the Login.
    End If

  End Sub

  Protected Sub Page_Init(ByVal
 sender As Object, ByVal
 e As System.EventArgs)
    
    Dim userText As HtmlInputText = New
 HtmlInputText
    userText.MaxLength = 20
    Placeholder1.Controls.Add(userText)

    Dim passwordText As HtmlInputPassword =
 New HtmlInputPassword
    passwordText.MaxLength = 20
    Placeholder2.Controls.Add(passwordText)

    Dim submitButton As HtmlInputSubmit = New
 HtmlInputSubmit
    submitButton.Value = "Submit"
    Placeholder3.Controls.Add(submitButton)

  End Sub
</script>

<html  >
  <body>
    <form id="Form1" runat="server">

      <table cellpadding="2">
        <tr>
        <td>User Name
            <asp:placeholder
                runat="server"
                id="Placeholder1" />
        </td></tr>
        <tr>
        <td>Password
            <asp:placeholder
                runat="server"
                id="Placeholder2" />
        </td></tr>
        <tr><td><asp:placeholder
                runat="server"
                id="Placeholder3" />
        </td></tr>
      </table>
    </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">
  
  protected void page_load(object sender, EventArgs
 e)
  {
    if (IsPostBack)
    {
      // Add code to process the Login.
    }
  }

  protected void Page_Init(object sender, EventArgs
 e)
  {
    HtmlInputText userText = new HtmlInputText();
    userText.MaxLength = 20;
    Placeholder1.Controls.Add(userText);

    HtmlInputPassword passwordText = new HtmlInputPassword();
    passwordText.MaxLength = 20;
    Placeholder2.Controls.Add(passwordText);

    HtmlInputSubmit submitButton = new HtmlInputSubmit();
    submitButton.Value = "Submit";
    Placeholder3.Controls.Add(submitButton);
  }
</script>

<html  >
  <body>
    <form runat="server">

      <table cellpadding="2">
        <tr>
        <td>User Name
            <asp:placeholder
                runat="server"
                id="Placeholder1" />
        </td></tr>
        <tr>
        <td>Password
            <asp:placeholder
                runat="server"
                id="Placeholder2" />
        </td></tr>
        <tr><td><asp:placeholder
                runat="server"
                id="Placeholder3" />
        </td></tr>
      </table>
    </form>
  </body>
</html>
<%@ Page Language="VJ#" %>

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

<script runat="server">
  
  protected void Page_Load(Object sender, System.EventArgs
 e)
  {
    if (get_IsPostBack())
    {
      // Add code to process the Login.
    }

  }

  protected void Page_Init(Object sender, EventArgs
 e)
  {
    HtmlInputText userText = new HtmlInputText();
    userText.set_MaxLength(20);
    Placeholder1.get_Controls().Add(userText);

    HtmlInputPassword passwordText = new HtmlInputPassword();
    passwordText.set_MaxLength(20);
    Placeholder2.get_Controls().Add(passwordText);

    HtmlInputSubmit submitButton = new HtmlInputSubmit();
    submitButton.set_Value("Submit");
    Placeholder3.get_Controls().Add(submitButton);


  }
</script>

<html  >
  <body>
    <form runat="server">

      <table cellpadding="2">
        <tr>
        <td>User Name
            <asp:placeholder
                runat="server"
                id="Placeholder1" />
        </td></tr>
        <tr>
        <td>Password
            <asp:placeholder
                runat="server"
                id="Placeholder2" />
        </td></tr>
        <tr><td><asp:placeholder
                runat="server"
                id="Placeholder3" />
        </td></tr>
      </table>
    </form>
  </body>
</html>
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
HtmlInputSubmit クラス
HtmlInputSubmit メンバ
System.Web.UI.HtmlControls 名前空間



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

辞書ショートカット

すべての辞書の索引

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

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

   

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



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

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

©2025 GRAS Group, Inc.RSS