HtmlInputText.ServerChange イベント
アセンブリ: System.Web (system.web.dll 内)

Public Event ServerChange As EventHandler
public event EventHandler ServerChange
public: event EventHandler^ ServerChange { void add (EventHandler^ value); void remove (EventHandler^ value); }
/** @event */ public void add_ServerChange (EventHandler value) /** @event */ public void remove_ServerChange (EventHandler value)

Value プロパティがサーバー上で変更されたときに、ServerChange イベントが発生します。
![]() |
---|
ServerChange イベントを正常に動作させるためには、コントロールのビューステートを有効にしておく必要があります。 |

ServerChange イベントのハンドラを指定およびコーディングする方法を次のコード例に示します。カスタム イベント ハンドラは、Web ページ上のラベルを更新して、<input type=text> HTML 要素に入力したテキストの値を表示します。
<%@ Page Language="VB" AutoEventWireup="True" %> <html> <head> <script runat="server"> Sub Server_Change(ByVal sender As Object, ByVal e As EventArgs) Span1.InnerHtml = String.Format("You typed: {0}", Text1.Value) End Sub Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) ' 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 Text1.ServerChange, AddressOf Server_Change End Sub </script> </head> <body> <form runat="server"> <h3>HtmlInputText ServerChange Example</h3> Enter a value in the input field below and click the Submit button. <br> <input type="text" id="Text1" runat="server"/> <br> <input type="submit" id="Button1" value="Submit" runat="server"/> <p> <span id="Span1" runat="server" /> </form> </body> </html>
<%@ Page Language="C#" AutoEventWireup="True" %> <html> <head> <script runat="server"> void Server_Change(object sender, EventArgs e) { Span1.InnerHtml = "You typed: " + Text1.Value; } void Page_Load(object sender, EventArgs e) { // 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. Text1.ServerChange += new System.EventHandler(this.Server_Change); } </script> </head> <body> <form runat="server"> <h3>HtmlInputText ServerChange Example</h3> Enter a value in the input field below and click the Submit button. <br> <input type="text" id="Text1" runat="server"/> <br> <p> <input type="submit" id="Button1" value="Submit" runat="server"/> <p> <span id="Span1" 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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からHtmlInputText.ServerChange イベントを検索する場合は、下記のリンクをクリックしてください。

- HtmlInputText.ServerChange イベントのページへのリンク