Przeglądaj źródła

* CheckBox.cs: Do not change the status of a checkbox when there
is no postback data. This fixes bug #49091.

svn path=/trunk/mcs/; revision=19464

Jackson Harper 22 lat temu
rodzic
commit
fd8e225066

+ 5 - 0
mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog

@@ -1,3 +1,8 @@
+2003-10-29 Jackson Harper <[email protected]>
+
+	* CheckBox.cs: Do not change the status of a checkbox when there
+	is no postback data. This fixes bug #49091.
+	
 2003-10-26 Ben Maurer  <[email protected]>
 
 	* RadioButton.cs: Patch by Yaron Shkop. Enables disabling a

+ 5 - 1
mcs/class/System.Web/System.Web.UI.WebControls/CheckBox.cs

@@ -205,7 +205,11 @@ namespace System.Web.UI.WebControls
 		bool IPostBackDataHandler.LoadPostData (string postDataKey, NameValueCollection postCollection)
 		{
 			string postedVal = postCollection [postDataKey];
-			bool haveData = (postedVal != null && postedVal.Length > 0);
+
+                        if (postedVal == null)
+                                return false;
+                        
+			bool haveData = (postedVal.Length > 0);
 			if (haveData == Checked)
 				return false;