IPostBackEventHandler.RaisePostBackEvent メソッドとは? わかりやすく解説

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

IPostBackEventHandler.RaisePostBackEvent メソッド

クラスによって実装された場合は、フォームサーバーポストされたときに発生するイベントサーバー コントロール処理できるようにします。

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

Sub RaisePostBackEvent ( _
    eventArgument As String _
)
Dim instance As IPostBackEventHandler
Dim eventArgument As String

instance.RaisePostBackEvent(eventArgument)
void RaisePostBackEvent (
    string eventArgument
)
void RaisePostBackEvent (
    String^ eventArgument
)
void RaisePostBackEvent (
    String eventArgument
)
function RaisePostBackEvent (
    eventArgument : String
)

パラメータ

eventArgument

イベント ハンドラ渡される省略可能なイベント引数を表す String

解説解説
使用例使用例

ポストバック発生させるカスタム ボタン サーバー コントロール定義し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' />");   
      }
   }    
}
   
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

「IPostBackEventHandler.RaisePostBackEvent メソッド」の関連用語











IPostBackEventHandler.RaisePostBackEvent メソッドのお隣キーワード
検索ランキング

   

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



IPostBackEventHandler.RaisePostBackEvent メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS