本文整理匯總了C#中System.Web.UI.WebControls.Button.IPostBackEventHandler.RaisePostBackEvent方法的典型用法代碼示例。如果您正苦於以下問題:C# Button.IPostBackEventHandler.RaisePostBackEvent方法的具體用法?C# Button.IPostBackEventHandler.RaisePostBackEvent怎麽用?C# Button.IPostBackEventHandler.RaisePostBackEvent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。
在下文中一共展示了Button.IPostBackEventHandler.RaisePostBackEvent方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Render
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!";
}
}
}
開發者ID:.NET開發者,項目名稱:System.Web.UI.WebControls,代碼行數:31,代碼來源:Button.IPostBackEventHandler.RaisePostBackEvent