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);
#if NET_2_0
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);
#else
if (CausesValidation && page != null && page.AreValidatorsUplevel ()) {
ClientScriptManager csm = new ClientScriptManager (page);
writer.AddAttribute (HtmlTextWriterAttribute.Onclick, csm.GetClientValidationEvent ());
writer.AddAttribute ("language", "javascript");
}
#endif
}