* roottypes.cs: Rename from tree.cs.
[mono.git] / mcs / class / System.Web / System.Web.UI.WebControls / Button.cs
index f6bd105a97874bdc93d30c5e2238000663dd27b6..b1e86f2dc665e6be7894f82dfadac220653f552e 100644 (file)
@@ -89,11 +89,8 @@ namespace System.Web.UI.WebControls {
                [WebCategory ("Behavior")]
 #if NET_2_0
                [Themeable (false)]
-               public virtual
-#else          
-               public
 #endif         
-               string CommandArgument {
+               public string CommandArgument {
                        get {
                                return ViewState.GetString ("CommandArgument", "");
                        }
@@ -107,11 +104,8 @@ namespace System.Web.UI.WebControls {
                [WebCategory ("Behavior")]
 #if NET_2_0
                [Themeable (false)]
-               public virtual
-#else
-               public
 #endif         
-               string CommandName {
+               public string CommandName {
                        get {
                                return ViewState.GetString ("CommandName", "");
                        }
@@ -144,11 +138,8 @@ namespace System.Web.UI.WebControls {
                [WebCategory ("Appearance")]
 #if NET_2_0
                [Localizable (true)]
-               public virtual
-#else          
-               public
 #endif         
-               string Text {
+               public string Text {
                        get {
                                return ViewState.GetString ("Text", "");
                        }
@@ -180,17 +171,19 @@ namespace System.Web.UI.WebControls {
                                Page.VerifyRenderingInServerForm (this);
 
                        writer.AddAttribute (HtmlTextWriterAttribute.Type, "submit");
-#if NET_2_0
-                       if (ID != null)
-                               writer.AddAttribute (HtmlTextWriterAttribute.Name, UniqueID);
-#else
                        writer.AddAttribute (HtmlTextWriterAttribute.Name, UniqueID);
-#endif
                        writer.AddAttribute (HtmlTextWriterAttribute.Value, Text);
 
                        if (CausesValidation && Page != null && Page.AreValidatorsUplevel ()) {
+                               string onclick = Attributes["onclick"];
+                               if (onclick != null) {
+                                       Attributes.Remove("onclick");
+                                       int len = onclick.Length;
+                                       if (len > 0 && onclick[len - 1] != ';')
+                                               onclick += ";";
+                               }
                                ClientScriptManager csm = new ClientScriptManager (Page);
-                               writer.AddAttribute (HtmlTextWriterAttribute.Onclick, csm.GetClientValidationEvent ());
+                               writer.AddAttribute (HtmlTextWriterAttribute.Onclick, onclick + csm.GetClientValidationEvent ());
                                writer.AddAttribute ("language", "javascript");
                        }
 
@@ -285,12 +278,12 @@ namespace System.Web.UI.WebControls {
                [Themeable (false)]
                [UrlProperty("*.aspx")]
                [MonoTODO]
-               public string PostBackUrl {
+               public virtual string PostBackUrl {
                        get {
-                               throw new NotImplementedException ();
+                               return ViewState.GetString ("PostBackUrl", "");
                        }
                        set {
-                               throw new NotImplementedException ();
+                               ViewState ["PostBackUrl"] = value;
                        }
                }
 
@@ -298,7 +291,7 @@ namespace System.Web.UI.WebControls {
                [Themeable (false)]
                [WebSysDescription ("")]
                [WebCategoryAttribute ("Behavior")]
-               public string ValidationGroup {
+               public virtual string ValidationGroup {
                        get {
                                return ViewState.GetString ("ValidationGroup", "");
                        }