📄 htmlbutton.cs
字号:
using System;
namespace System.Web.UI.HtmlControls
{
/// <summary>
/// Summary description for HtmlButton.
/// </summary>
//.custom instance void [System]System.ComponentModel.DefaultEventAttribute
public class HtmlButton : HtmlContainerControl,IPostBackEventHandler
{
private static object EventServerClick;
static HtmlButton()
{
HtmlButton.EventServerClick = new Object();
}
public HtmlButton() : base("button")
{
}
protected virtual void OnPreRender(EventArgs e)
{
this.OnPreRender(e);
if (this.Page != null && (this.Events[HtmlButton.EventServerClick]!= null))
this.Page.RegisterPostBackScript();
}
protected virtual void OnServerClick(EventArgs e)
{
EventHandler local0;
local0 = (EventHandler) this.Events[HtmlButton.EventServerClick];
if (local0 != null)
local0.Invoke(this, e);
}
protected virtual void RenderAttributes(HtmlTextWriter writer)
{
bool local0;
local0 =this.Events[HtmlButton.EventServerClick]!= null;
if (this.Page != null && local0)
{
if (this.CausesValidation)
{
// goto i-1;
}
// System.Web.UI.Util.WriteOnClickAttribute(this, 0, true, this.Page.Validators.Count > 0, false);
}
this.RenderAttributes(writer);
}
void System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(string eventArgument)
{
if (this.CausesValidation)
this.Page.Validate();
this.OnServerClick(System.EventArgs.Empty);
}
public event EventHandler ServerClick
{
add
{
this.Events.AddHandler(HtmlButton.EventServerClick, value);
}
remove
{
this.Events.RemoveHandler(HtmlButton.EventServerClick, value);
}
}
public bool CausesValidation
{
get
{
object local0;
local0 = this.ViewState["CausesValidation"];
if (local0 != null)
return (Boolean) local0;
return true;
}
set
{
this.ViewState["CausesValidation"]=value;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -