2004-06-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
[mono.git] / mcs / class / System.Web / System.Web.UI.WebControls / ImageButton.cs
index b9bc9f6805593c81489e6e4cc6ffbf6012bbf2a9..a4405bca1bdb25f4ac7fae66d6b12aa085aa9254 100644 (file)
@@ -81,6 +81,8 @@ namespace System.Web.UI.WebControls
                        }\r
                }\r
 \r
+               [Browsable (false)]
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
                protected override HtmlTextWriterTag TagKey\r
                {\r
                        get\r
@@ -165,12 +167,22 @@ namespace System.Web.UI.WebControls
                {\r
                        string xCoord = postCollection[UniqueID + ".x"];\r
                        string yCoord = postCollection[UniqueID + ".y"];\r
+                       string id = postCollection[UniqueID];
                        if(xCoord != null && yCoord != null && xCoord.Length > 0 && yCoord.Length > 0)\r
                        {\r
                                x = Int32.Parse(xCoord);\r
                                y = Int32.Parse(yCoord);\r
-                               Page.RegisterRequiresRaiseEvent(this);\r
-                       }\r
+                               Page.RegisterRequiresRaiseEvent(this);
+                       } else if (id != null)
+                       {
+                                //
+                                // This is a workaround for bug #49819. It appears that the .x and .y
+                                // values are not being posted, and only the x value is being posted
+                                // with the ctrl's id as the key.
+                                //
+                               x = Int32.Parse (id);
+                               Page.RegisterRequiresRaiseEvent (this);
+                       }
                        return false;\r
                }\r
 \r