protected override void AddAttributesToRender (HtmlTextWriter w)
{
Page page = Page;
if (page != null)
page.VerifyRenderingInServerForm (this);
base.AddAttributesToRender (w);
bool enabled = IsEnabled;
string onclick = OnClientClick;
onclick = ClientScriptManager.EnsureEndsWithSemicolon (onclick);
if (HasAttributes && Attributes ["onclick"] != null) {
onclick = ClientScriptManager.EnsureEndsWithSemicolon (onclick + Attributes ["onclick"]);
Attributes.Remove ("onclick");
}
if (onclick.Length > 0)
w.AddAttribute (HtmlTextWriterAttribute.Onclick, onclick);
if (enabled && page != null) {
PostBackOptions options = GetPostBackOptions ();
string href = page.ClientScript.GetPostBackEventReference (options, true);
w.AddAttribute (HtmlTextWriterAttribute.Href, href);
}
AddDisplayStyleAttribute (w);
}