IPostBackEventHandler インターフェイスとは? わかりやすく解説

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

IPostBackEventHandler インターフェイス

ポストバック イベント処理するために ASP.NET サーバー コントロール実装する必要があるメソッド定義します

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

Public Interface IPostBackEventHandler
Dim instance As IPostBackEventHandler
public interface IPostBackEventHandler
public interface class IPostBackEventHandler
public interface IPostBackEventHandler
public interface IPostBackEventHandler
解説解説
使用例使用例

ポストバック発生させるカスタム ボタン サーバー コントロール定義し、RaisePostBackEvent メソッド使用してポストバック イベントキャプチャして、サーバーClick イベント発生させるコード例次に示します

Imports System
Imports System.Web.UI
Imports System.Collections
Imports System.Collections.Specialized

Namespace CustomControls    
    
    <System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.Demand,
 Name:="FullTrust")> Public
 Class MyButton
        Inherits Control
        Implements IPostBackEventHandler
        
        ' Define the Click event.
        Public Event Click As
 EventHandler
        
        
        ' Invoke delegates registered with the Click event.
        Protected Overridable Sub
 OnClick(e As EventArgs)            
            RaiseEvent Click(Me, e)
        End Sub
        
        
        ' Define the method of IPostBackEventHandler that raises change
 events.
        Public Sub RaisePostBackEvent(eventArgument
 As String) _
        Implements IPostBackEventHandler.RaisePostBackEvent
        
            OnClick(New EventArgs())
        End Sub       
        
        
        Protected Overrides Sub
 Render(output As HtmlTextWriter)
            output.Write("<INPUT TYPE = submit name = "
 & Me.UniqueID & _
                " Value = 'Click Me' />")
        End Sub
        
    End Class
End Namespace

using System;
using System.Web.UI;
using System.Collections;
using System.Collections.Specialized;

namespace CustomControls {

   [System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand,
 Name="FullTrust")]   
   public class MyButton: Control, IPostBackEventHandler
 {
      
      // Defines the Click event.
      public event EventHandler Click;
      
      //Invoke delegates registered with the Click event.
      protected virtual void OnClick(EventArgs
 e) {
         
         if (Click != null) {
            Click(this, e);
         }   
      }
      
      
      // Define the method of IPostBackEventHandler that raises change
 events.
      public void RaisePostBackEvent(string
 eventArgument){
         
         OnClick(new EventArgs());
      }
      
      
      protected override void Render(HtmlTextWriter
 output) {
         output.Write("<INPUT TYPE = submit name = " + this.UniqueID
 + 
            " Value = 'Click Me' />");   
      }
   }    
}
   
.NET Framework のセキュリティ.NET Frameworkセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

「IPostBackEventHandler インターフェイス」の関連用語

IPostBackEventHandler インターフェイスのお隣キーワード
検索ランキング

   

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



IPostBackEventHandler インターフェイスのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS