protected override void AddAttributesToRender (HtmlTextWriter writer)
{
Page page = Page;
if (page != null)
page.VerifyRenderingInServerForm (this);
writer.AddAttribute (HtmlTextWriterAttribute.Type, "image", false);
writer.AddAttribute (HtmlTextWriterAttribute.Name, UniqueID);
base.AddAttributesToRender (writer);
string onclick = OnClientClick;
if (!String.IsNullOrEmpty (onclick))
onclick = ClientScriptManager.EnsureEndsWithSemicolon (onclick);
else
onclick = String.Empty;
if (HasAttributes && Attributes ["onclick"] != null) {
onclick = ClientScriptManager.EnsureEndsWithSemicolon (onclick + Attributes ["onclick"]);
Attributes.Remove ("onclick");
}
if (page != null)
onclick += GetClientScriptEventReference ();
if (onclick.Length > 0)
writer.AddAttribute (HtmlTextWriterAttribute.Onclick, onclick);
}