HtmlButton イベント

名前 | 説明 | |
---|---|---|
![]() | DataBinding | サーバー コントロールがデータ ソースに連結すると発生します。 ( Control から継承されます。) |
![]() | Disposed | サーバー コントロールがメモリから解放されると発生します。これは、ASP.NET ページが要求されている場合のサーバー コントロールの有効期間における最終段階です。 ( Control から継承されます。) |
![]() | Init | サーバー コントロールが初期化されると発生します。これは、サーバー コントロールの有効期間における最初の手順です。 ( Control から継承されます。) |
![]() | Load | サーバー コントロールが Page オブジェクトに読み込まれると発生します。 ( Control から継承されます。) |
![]() | PreRender | Control オブジェクトの読み込み後、表示を開始する前に発生します。 ( Control から継承されます。) |
![]() | ServerClick | クライアント Web ページで HtmlButton コントロールがクリックされたときに発生します。 |
![]() | Unload | サーバー コントロールがメモリからアンロードされると発生します。 ( Control から継承されます。) |

関連項目
HtmlButton クラスSystem.Web.UI.HtmlControls 名前空間
HtmlContainerControl
ServerClick
その他の技術情報
ASP.NET Web ページのクライアント スクリプトHtmlButton サーバー コントロール宣言構文
HTML サーバー コントロール
HtmlButton クラス
アセンブリ: System.Web (system.web.dll 内)


<button> 要素を使用すると、Web 開発者は、他のサーバー コントロールを含む埋め込み HTML 要素で構成できるユーザー インターフェイス (UI) フォーム ボタンを作成できます。
![]() |
---|
このコントロールは、ユーザー入力を表示するために使用できます。ユーザー入力には悪意のあるクライアント スクリプトが含まれている可能性があります。アプリケーションに表示する前に、クライアントから送信された実行スクリプト、SQL ステートメントなどのコードの情報はすべて検査してください。ASP.NET には入力要求の検証機能があり、ユーザー入力の中のスクリプトと HTML をブロックできます。検証サーバー コントロールは、ユーザー入力を査定する目的でも用意されています。詳細については、「検証サーバー コントロール構文」を参照してください。 |

ServerClick イベントを使用して、テキスト ボックスに入力された名前を表示する方法を次のコード例に示します。
<%@ Page Language="VB" AutoEventWireup="True" %> <html> <script language="VB" runat=server> Sub FancyBtn_Click(Source As Object, E as EventArgs) Message.InnerHtml = "Your name is: " & Name.Value End Sub </script> <body> <form method=post runat=server> <h3> Enter Name: <input id="Name" type=text size=40 runat=server> </h3> <button OnServerClick=" FancyBtn_Click" runat=server> <b><I> I'm a fancy HTML 4.0 button </I> </b> </button> <h1> <span id="Message" runat=server></span> </h1> </form> </body> </html>
<%@ Page Language="C#" AutoEventWireup="True" %> <html> <script language="C#" runat=server> protected void FancyBtn_Click(object sender, EventArgs e) { Message.InnerHtml = "Your name is: " + Name.Value; } </script> <body> <form method=post runat=server> <h3> Enter Name: <input id="Name" type=text size=40 runat=server> </h3> <button OnServerClick=" FancyBtn_Click" runat=server id="BUTTON1"> <b><I> I'm a fancy HTML 4.0 button </I> </b> </button> <h1> <span id="Message" runat=server></span> </h1> </form> </body> </html>
<%@ Page Language="JScript" AutoEventWireup="True" %> <html> <script language="jscript" runat=server> function FancyBtn_Click(Source: Object, E: EventArgs){ Message.InnerHtml = "Your name is: " + Name.Value } </script> <body> <form method=post runat=server> <h3> Enter Name: <input id="Name" type=text size=40 runat=server> </h3> <button OnServerClick=" FancyBtn_Click" runat=server> <b><I> I'm a fancy HTML 4.0 button </I> </b> </button> <h1> <span id="Message" runat=server></span> </h1> </form> </body> </html>


System.Web.UI.Control
System.Web.UI.HtmlControls.HtmlControl
System.Web.UI.HtmlControls.HtmlContainerControl
System.Web.UI.HtmlControls.HtmlButton


Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


HtmlButton コンストラクタ
アセンブリ: System.Web (system.web.dll 内)



Web フォーム ページに HtmlButton コントロールを動的に追加する方法を次のコード例に示します。
<%@ Page Language="VB" AutoEventWireup="True" %> <html> <head> <script runat="server"> Sub Page_Load(sender As Object, e As EventArgs) ' Create a new HtmlButton control. Dim NewButtonControl As New HtmlButton() ' Set the properties of the new HtmlButton control. NewButtonControl.ID = "NewButtonControl" NewButtonControl.InnerHtml = "Click Me" ' Create an EventHandler delegate for the method you want to handle the event ' and then add it to the list of methods called when the event is raised. AddHandler NewButtonControl.ServerClick, AddressOf Button_Click ' Add the new HtmlButton control to the Controls collection of the ' PlaceHolder control. ControlContainer.Controls.Add(NewButtonControl) End Sub Sub Button_Click(sender As Object, e As EventArgs) ' Display a simple message. Message.InnerHtml = "Thank you for clicking the button." End Sub </script> </head> <body> <form runat="server"> <h3> HtmlButton Constructor Example </h3> <asp:PlaceHolder ID="ControlContainer" runat="server"/> <br><br> <span ID="Message" runat="server"/> </form> </body> </html>
<%@ Page Language="C#" AutoEventWireup="True" %> <html> <head> <script runat="server"> void Page_Load(Object sender, EventArgs e) { // Create a new HtmlButton control. HtmlButton NewButtonControl = new HtmlButton(); // Set the properties of the new HtmlButton control. NewButtonControl.ID = "NewButtonControl"; NewButtonControl.InnerHtml = "Click Me"; // Create an EventHandler delegate for the method you want to handle the event // and then add it to the list of methods called when the event is raised. NewButtonControl.ServerClick += new System.EventHandler(this.Button_Click); // Add the new HtmlButton control to the Controls collection of the // PlaceHolder control. ControlContainer.Controls.Add(NewButtonControl); } void Button_Click(Object sender, EventArgs e) { // Display a simple message. Message.InnerHtml = "Thank you for clicking the button."; } </script> </head> <body> <form runat="server"> <h3> HtmlButton Constructor Example </h3> <asp:PlaceHolder ID="ControlContainer" runat="server"/> <br><br> <span ID="Message" runat="server"/> </form> </body> </html>

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


HtmlButton プロパティ



関連項目
HtmlButton クラスSystem.Web.UI.HtmlControls 名前空間
HtmlContainerControl
ServerClick
その他の技術情報
ASP.NET Web ページのクライアント スクリプトHtmlButton サーバー コントロール宣言構文
HTML サーバー コントロール
HtmlButton メソッド



名前 | 説明 | |
---|---|---|
![]() | System.Web.UI.IPostBackEventHandler.RaisePostBackEvent | サーバーへのポストバック時に、HtmlButton コントロールのイベントを発生させます。 |

関連項目
HtmlButton クラスSystem.Web.UI.HtmlControls 名前空間
HtmlContainerControl
ServerClick
その他の技術情報
ASP.NET Web ページのクライアント スクリプトHtmlButton サーバー コントロール宣言構文
HTML サーバー コントロール
HtmlButton メンバ
サーバーの HTML <button> タグへのプログラムによるアクセスを許可します。
HtmlButton データ型で公開されるメンバを以下の表に示します。






名前 | 説明 | |
---|---|---|
![]() | DataBinding | サーバー コントロールがデータ ソースに連結すると発生します。(Control から継承されます。) |
![]() | Disposed | サーバー コントロールがメモリから解放されると発生します。これは、ASP.NET ページが要求されている場合のサーバー コントロールの有効期間における最終段階です。(Control から継承されます。) |
![]() | Init | サーバー コントロールが初期化されると発生します。これは、サーバー コントロールの有効期間における最初の手順です。(Control から継承されます。) |
![]() | Load | サーバー コントロールが Page オブジェクトに読み込まれると発生します。(Control から継承されます。) |
![]() | PreRender | Control オブジェクトの読み込み後、表示を開始する前に発生します。(Control から継承されます。) |
![]() | ServerClick | クライアント Web ページで HtmlButton コントロールがクリックされたときに発生します。 |
![]() | Unload | サーバー コントロールがメモリからアンロードされると発生します。(Control から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | System.Web.UI.IPostBackEventHandler.RaisePostBackEvent | サーバーへのポストバック時に、HtmlButton コントロールのイベントを発生させます。 |

関連項目
HtmlButton クラスSystem.Web.UI.HtmlControls 名前空間
HtmlContainerControl
ServerClick
その他の技術情報
ASP.NET Web ページのクライアント スクリプトHtmlButton サーバー コントロール宣言構文
HTML サーバー コントロール
Weblioに収録されているすべての辞書からHtmlButtonを検索する場合は、下記のリンクをクリックしてください。

- HtmlButtonのページへのリンク