Sfoglia il codice sorgente

2009-05-29 Marek Habersack <[email protected]>

	* ListItem.cs: when tracking view state is turned on after
	attributes have been set, make sure that the associated state bag
	begins tracking state and that all of its existing items are
	marked as dirty. Do the same after loading view state. Fixes bug
	#507836

2009-05-29  Marek Habersack  <[email protected]>

	* StateBag.cs: made SetDirty (bool) available on 1.1 as
	internal. Fixes bug #507836

svn path=/trunk/mcs/; revision=135057
Marek Habersack 16 anni fa
parent
commit
540708a71f

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

@@ -1,3 +1,11 @@
+2009-05-29  Marek Habersack  <[email protected]>
+
+	* ListItem.cs: when tracking view state is turned on after
+	attributes have been set, make sure that the associated state bag
+	begins tracking state and that all of its existing items are
+	marked as dirty. Do the same after loading view state. Fixes bug
+	#507836
+
 2009-04-29  Marek Habersack  <[email protected]>
 
 	* DataBoundControl.cs: added InternalGetDataSource method, used by

+ 8 - 3
mcs/class/System.Web/System.Web.UI.WebControls/ListItem.cs

@@ -4,7 +4,7 @@
 // Authors:
 //	Ben Maurer ([email protected])
 //
-// (C) 2005 Novell, Inc (http://www.novell.com)
+// (C) 2005-2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -116,6 +116,7 @@ namespace System.Web.UI.WebControls {
 			if (states [0] != null) {
 				sb = new StateBag (true);
 				sb.LoadViewState (states[0]);
+				sb.SetDirty (true);
 			}
 			
 			if (states [1] != null)
@@ -163,6 +164,10 @@ namespace System.Web.UI.WebControls {
 		internal void TrackViewState ()
 		{
 			tracking = true;
+			if (sb != null) {
+				sb.TrackViewState ();
+				sb.SetDirty (true);
+			}
 		}
 
 		public override string ToString ()
@@ -209,7 +214,7 @@ namespace System.Web.UI.WebControls {
 				if (r == null)
 					r = value;
 				if (r == null)
-					r = "";
+					r = String.Empty;
 				return r;
 			}
 		
@@ -227,7 +232,7 @@ namespace System.Web.UI.WebControls {
 				if (r == null)
 					r = text;
 				if (r == null)
-					r = "";
+					r = String.Empty;
 				return r;
 			}
 		

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

@@ -1,3 +1,8 @@
+2009-05-29  Marek Habersack  <[email protected]>
+
+	* StateBag.cs: made SetDirty (bool) available on 1.1 as
+	internal. Fixes bug #507836
+
 2009-05-05  Marek Habersack  <[email protected]>
 
 	* TemplateParser.cs: PageParserFilterType uses

+ 5 - 2
mcs/class/System.Web/System.Web.UI/StateBag.cs

@@ -271,13 +271,16 @@ namespace System.Web.UI {
 		}
 
 #if NET_2_0
-		public void SetDirty (bool dirty)
+		public
+#else
+		internal
+#endif
+		void SetDirty (bool dirty)
 		{
 			foreach (DictionaryEntry de in ht) {
 				StateItem si = (StateItem) de.Value;
 				si.IsDirty = dirty;
 			}
 		}
-#endif
 	}
 }