Procházet zdrojové kódy

fixed LoadViewState() implementation.
Always loading the saved attributes collection.

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

Alon Gazit před 21 roky
rodič
revize
3b474d99b6

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

@@ -1,3 +1,7 @@
+2004-04-28 Alon Gazit <[email protected]>
+        * WebControl.cs: fixed LoadViewState(). 
+        Always loading the saved attributes collection.
+
 2004-04-18 Alon Gazit <[email protected]>
 	* Repeater.cs: fixed InstantiateItem() and DataSource property.
 	The change in DataSource prevents throwing ArgumentException while

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

@@ -427,8 +427,12 @@ namespace System.Web.UI.WebControls
 			if (ControlStyleCreated || ViewState [System.Web.UI.WebControls.Style.selectionBitString] != null)
 				ControlStyle.LoadViewState (null);
 
-			if (attributeState != null)
+			if (saved.Second != null)
+			{
+				attributeState = new StateBag(true);
+				attributeState.TrackViewState();
 				attributeState.LoadViewState (saved.Second);
+			}
 		}
 
 		protected override void Render(HtmlTextWriter writer)