* Calendar.cs: Match MS postback data. This allows sites that
[mono.git] / mcs / class / System.Web / System.Web.UI.WebControls / ImageButton.cs
index c318dd3c002b68682df4340588a3bc44c6bd3aea..508d27c71691c6d377200a43c38994428a773061 100644 (file)
@@ -1,15 +1,13 @@
-/**\r
- * Namespace: System.Web.UI.WebControls\r
- * Class:     ImageButton\r
- *\r
- * Author:  Gaurav Vaish\r
- * Maintainer: gvaish@iitk.ac.in\r
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>\r
- * Implementation: yes\r
- * Status:  100%\r
- *\r
- * (C) Gaurav Vaish (2001)\r
- */\r
+//
+// System.Web.UI.WebControls.ImageButton.cs
+//
+// Authors:
+//   Gaurav Vaish (gvaish@iitk.ac.in)
+//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
+//
+// (C) Gaurav Vaish (2002)
+// (C) 2003 Andreas Nahr
+//\r
 \r
 using System;\r
 using System.Collections;\r
@@ -31,7 +29,9 @@ namespace System.Web.UI.WebControls
                public ImageButton(): base()\r
                {\r
                }\r
-\r
+
+               [DefaultValue (true), Bindable (false), WebCategory ("Behavior")]
+               [WebSysDescription ("Determines if validation is performed when clicked.")]\r
                public bool CausesValidation\r
                {\r
                        get\r
@@ -46,7 +46,9 @@ namespace System.Web.UI.WebControls
                                ViewState["CausesValidation"] = value;\r
                        }\r
                }\r
-\r
+
+               [DefaultValue (""), Bindable (true), WebCategory ("Behavior")]
+               [WebSysDescription ("An argument for the Command of this control.")]\r
                public string CommandArgument\r
                {\r
                        get\r
@@ -61,7 +63,9 @@ namespace System.Web.UI.WebControls
                                ViewState["CommandArgument"] = value;\r
                        }\r
                }\r
-\r
+
+               [DefaultValue (""), WebCategory ("Behavior")]
+               [WebSysDescription ("The name of the Command of this control.")]\r
                public string CommandName\r
                {\r
                        get\r
@@ -84,7 +88,9 @@ namespace System.Web.UI.WebControls
                                return HtmlTextWriterTag.Input;\r
                        }\r
                }\r
-\r
+
+               [WebCategory ("Action")]
+               [WebSysDescription ("Raised when the LinkButton is clicked.")]\r
                public event ImageClickEventHandler Click\r
                {\r
                        add\r
@@ -96,7 +102,9 @@ namespace System.Web.UI.WebControls
                                Events.RemoveHandler(ClickEvent, value);\r
                        }\r
                }\r
-\r
+
+               [WebCategory ("Action")]
+               [WebSysDescription ("Raised when a LinkButton Command is executed.")]\r
                public event CommandEventHandler Command\r
                {\r
                        add\r
@@ -157,12 +165,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