Quellcode durchsuchen

2002-06-07 Gonzalo Paniagua Javier <[email protected]>

	* HtmlInputHidden.cs: fixed constructor.

	* HtmlInputRadioButton.cs:
	(RenderAttributes): fixed stack overflow.

	(Name):
	(RenderedName): new -> override.

	(Value): new property.

	* HtmlInputText.cs:
	(RenderAttributes): fixed the same kind of stack overflow and make
	string comparison case insensitive.

svn path=/trunk/mcs/; revision=5155
Gonzalo Paniagua Javier vor 23 Jahren
Ursprung
Commit
422b632e91

+ 16 - 0
mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog

@@ -1,3 +1,19 @@
+2002-06-07  Gonzalo Paniagua Javier <[email protected]>
+
+	* HtmlInputHidden.cs: fixed constructor.
+
+	* HtmlInputRadioButton.cs:
+	(RenderAttributes): fixed stack overflow.
+
+	(Name):
+	(RenderedName): new -> override.
+
+	(Value): new property. 
+
+	* HtmlInputText.cs:
+	(RenderAttributes): fixed the same kind of stack overflow and make
+	string comparison case insensitive.
+
 2002-06-07  Gonzalo Paniagua Javier <[email protected]>
 
 	* HtmlForm.cs: fixed name of Enctype property and render enctype

+ 3 - 1
mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputHidden.cs

@@ -15,7 +15,9 @@ namespace System.Web.UI.HtmlControls{
 		
 		private static readonly object EventServerChange;
 		
-		public HtmlInputHidden(string type):base("hidden"){}
+		public HtmlInputHidden () : base ("hidden")
+		{
+		}
 		
 		public bool LoadPostData(string postDataKey, NameValueCollection postCollection){
 			string postValue = postCollection[postDataKey];

+ 22 - 12
mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputRadioButton.cs

@@ -36,7 +36,7 @@ namespace System.Web.UI.HtmlControls{
 		protected override void RenderAttributes(HtmlTextWriter writer){
 			writer.WriteAttribute("value", Value);
 			Attributes.Remove("value");
-			RenderAttributes(writer);
+			base.RenderAttributes(writer);
 		}
 		
 		public bool LoadPostData(string postDataKey, NameValueCollection postCollection){
@@ -85,20 +85,16 @@ namespace System.Web.UI.HtmlControls{
 				Attributes["checked"] = "checked";
 			}
 		}
-		public new string Name{
-			get{
-				string attr = Attributes["name"];
-				if (attr != null){
-					return attr;
-				}
-				return String.Empty;
-			}
-			set{
-				Attributes["name"] = AttributeToString(value);
+		public override string Name
+		{
+			get {
+				string attr = Attributes ["name"]; // Gotta use "name" to group radio buttons
+				return (attr == null) ? String.Empty : attr;
 			}
+			set { Attributes ["name"] = value; }
 		}
 		
-		private new string RenderedName{
+		protected override string RenderedName{
 			get{
 				string attr = base.RenderedName;
 				string id = UniqueID;
@@ -109,6 +105,20 @@ namespace System.Web.UI.HtmlControls{
 				return attr;
 			}
 		}
+
+		public override string Value
+		{
+			get {
+				string v = Attributes ["value"];
+				if (v != null && v != "")
+					return v;
+				v = ID;
+				Attributes ["value"] = v;
+				return v;
+			}
+
+			set { Attributes ["value"] = value; }
+		}
 		
 	} // class HtmlInputRadioButton
 } // namespace System.Web.UI.HtmlControls

+ 2 - 3
mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputText.cs

@@ -31,10 +31,9 @@ namespace System.Web.UI.HtmlControls{
 		
 		protected override void RenderAttributes(HtmlTextWriter writer){
 			//hide value when password box
-			if (String.Compare(Type, "password") != 0){
+			if (String.Compare (Type, "password",true) != 0)
 				ViewState.Remove("value");
-			}
-			RenderAttributes(writer);
+			base.RenderAttributes(writer);
 		}
 		
 		public bool LoadPostData(string postDataKey, NameValueCollection postCollection){