本文整理汇总了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