Просмотр исходного кода

2007-01-07 Igor Zelmanovich <[email protected]>

	* HtmlInputRadioButton.cs: fixed: LoadPostData.		  


svn path=/trunk/mcs/; revision=70594
Igor Zelmanovich 19 лет назад
Родитель
Сommit
fa528f8d94

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

@@ -1,3 +1,7 @@
+2007-01-07  Igor Zelmanovich  <[email protected]>
+
+	* HtmlInputRadioButton.cs: fixed: LoadPostData.		  
+
 2007-01-07  Igor Zelmanovich  <[email protected]>
 
 	* HtmlImputImage.cs: fixed: OnServerClick.		  

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

@@ -128,43 +128,34 @@ namespace System.Web.UI.HtmlControls {
 			base.RenderAttributes (writer);
 		}
 #if NET_2_0
-		protected virtual bool LoadPostData (string postDataKey, NameValueCollection postCollection)
+		protected virtual 
+#endif
+		bool LoadPostData (string postDataKey, NameValueCollection postCollection)
 		{
-			return DefaultLoadPostData (postDataKey, postCollection);
-		}
+			bool checkedOnClient = postCollection [Name] == Value;
+			if (Checked == checkedOnClient)
+				return false;
 
-		protected virtual void RaisePostDataChangedEvent ()
-		{
-			OnServerChange (EventArgs.Empty);
+			Checked = checkedOnClient;
+			return checkedOnClient;
 		}
-#endif
 
-		internal bool DefaultLoadPostData (string postDataKey, NameValueCollection postCollection)
+#if NET_2_0
+		protected virtual 
+#endif
+		void RaisePostDataChangedEvent ()
 		{
-			string s = postCollection [postDataKey];
-			if ((s != null) && (Attributes ["value"] != postDataKey)) {
-				Attributes ["value"] = postDataKey;
-				// this doesn't seems to trigger a change
-			}
-			return false;
+			OnServerChange (EventArgs.Empty);
 		}
 
 		bool IPostBackDataHandler.LoadPostData (string postDataKey, NameValueCollection postCollection)
 		{
-#if NET_2_0
 			return LoadPostData (postDataKey, postCollection);
-#else
-			return DefaultLoadPostData (postDataKey, postCollection);
-#endif
 		}
 
 		void IPostBackDataHandler.RaisePostDataChangedEvent ()
 		{
-#if NET_2_0
 			RaisePostDataChangedEvent ();
-#else
-			OnServerChange (EventArgs.Empty);
-#endif
 		}