+ bool enabled = IsEnabled;
+#if NET_2_0
+ 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);
+ }
+ base.AddAttributesToRender (w);
+ AddDisplayStyleAttribute (w);
+#else