TemplateControl.Construct メソッド
名前空間: System.Web.UI
アセンブリ: System.Web (system.web.dll 内)
構文


TemplateControl クラスから派生したカスタム コントロールの Construct メソッドをオーバーライドする方法を次のコード例に示します。
MyControl クラスの完全な定義については、「TemplateControl」を参照してください。
' Create an event for this user control and ' name it myControl. Public Event myControl As System.EventHandler ' Override the default constructor. Protected Overrides Sub Construct() ' Specify the handler, MyInit, to be called when the myControl event ' is raised by the OnInit method. AddHandler Me.myControl, AddressOf MyInit End Sub 'Construct Protected Overrides Sub OnInit(e As EventArgs) RaiseEvent myControl(Me, e) Response.Write("The OnInit() method is used to raise the Init event.") End Sub 'OnInit ' Use the MyInit handler to set the Message property value ' when this method is called. Sub MyInit(sender As Object, e As System.EventArgs) _message = "Hello World!" End Sub 'MyInit
// Create an event for this user control and // name it myControl. public event System.EventHandler myControl; // Override the default constructor. protected override void Construct() { // Specify the handler, MyInit, to be called when the myControl event // is raised by the OnInit method. this.myControl += new System.EventHandler(MyInit); } protected override void OnInit( EventArgs e) { myControl(this ,e); Response.Write("The OnInit() method is used to raise the Init event."); } // Use the MyInit handler to set the Message property value // when this method is called. void MyInit(object sender,System.EventArgs e) { _message = "Hello World!"; }

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に収録されているすべての辞書からTemplateControl.Construct メソッドを検索する場合は、下記のリンクをクリックしてください。

- TemplateControl.Construct メソッドのページへのリンク