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

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

Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent メソッド

サーバーへのポストバック時にButton コントロールイベント発生させます

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

Private Sub System.Web.UI.IPostBackEventHandler.RaisePostBackEvent
 ( _
    eventArgument As String _
) Implements IPostBackEventHandler.RaisePostBackEvent
Dim instance As Button
Dim eventArgument As String

CType(instance, IPostBackEventHandler).RaisePostBackEvent(eventArgument)
void IPostBackEventHandler.RaisePostBackEvent (
    string eventArgument
)
private:
virtual void System.Web.UI.IPostBackEventHandler.RaisePostBackEvent
 (
    String^ eventArgument
) sealed = IPostBackEventHandler::RaisePostBackEvent

パラメータ

eventArgument

イベント引数

解説解説
使用例使用例

カスタム Button コントロールで常に OnClick イベント発生するように、System.Web.UI.IPostBackEventHandler.RaisePostBackEvent メソッドオーバーライドする方法次のコード例示します

<System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.Demand,
 Name:="FullTrust")> _
Public Class CustomButtonRaisePostBackEvent
    Inherits System.Web.UI.WebControls.Button

    Private message As String
 = System.String.Empty

    Protected Overrides Sub
 Render(ByVal writer As System.Web.UI.HtmlTextWriter)
        ' Render a HTML submit button.
        writer.Write("<INPUT TYPE='submit' name='" + Me.UniqueID
 + "' value='Click Me' />")
        writer.Write("<BR>" + message)
    End Sub

    ' Note: VB.NET does not allow one to re-implement a base class interface,
 whereas C# does.
    ' Hence, just use the base class's PostBackEventHandler's RaisePostBackEvent
 method,
    ' which calls the OnClick method.

    Protected Overrides Sub
 OnClick(ByVal e As System.EventArgs)
        message = "RaisePostBackEvent method successful!"
    End Sub
End Class
namespace Samples.AspNet.CS.Controls
{
  [System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand,
 Name="FullTrust")]
  public class CustomButtonRaisePostBackEvent
 : System.Web.UI.WebControls.Button, System.Web.UI.IPostBackEventHandler
  {
    private string message = System.String.Empty;

    protected override void Render(System.Web.UI.HtmlTextWriter
 writer) 
    {
      // Render a HTML submit button.
      writer.Write("<INPUT TYPE='submit' name='" + this.UniqueID
 + "' value='Click Me' />"); 
      writer.Write("<BR>" + message);
    }
    
    // Re-implement the IPostBackEventHandler's RaisePostBackEvent method.
    // Note: C# allows this, where VB.NET does not.
    public void RaisePostBackEvent(System.String
 eventArgument)
    {
      // Raise the Click event of the custom Button web control.
      OnClick(new System.EventArgs());

      // Don't call the Page.Validate or OnCommand events,
      // which the base IPostBackEventHandler's RaisePostBackEvent method
 does.
    }

    protected override void OnClick(System.EventArgs
 e)
    {
      message = "RaisePostBackEvent method successful!";
    }
  }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2024 GRAS Group, Inc.RSS