[Mono-bugs] [Bug 81945][Maj] New - Fix r80368 breaks consistency between WebControl's Load/SaveViewState.

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Mon Jun 25 08:10:03 EDT 2007


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by kostat at mainsoft.com.

http://bugzilla.ximian.com/show_bug.cgi?id=81945

--- shadow/81945	2007-06-25 08:10:03.000000000 -0400
+++ shadow/81945.tmp.14816	2007-06-25 08:10:03.000000000 -0400
@@ -0,0 +1,77 @@
+Bug#: 81945
+Product: Mono: Class Libraries
+Version: 1.2
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: Sys.Web
+AssignedTo: mhabersack at novell.com                            
+ReportedBy: kostat at mainsoft.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Summary: Fix r80368 breaks consistency between WebControl's Load/SaveViewState.
+
+Fix r80368 breaks consistency between WebControl's Load/SaveViewState.
+
+See the mail thread for more details:
+
+> The problem here is that we're not consistent in how we save the view
+> state
+> throughout various controls.
+That's not correct! As Igor said below: "The control tree into which
+viewstate is being loaded must match the control tree that was used to save
+viewstate during the previous request". Only this matters for consistency
+(as with any serialization/deserialization logic), if you find such an
+issue, please point on it.
+
+This consistency is the reason for the exception thrown in our code. The
+very same behavior is seen in MS .net (see #78533), but, in case of an
+empty DropDownList, they probably have 'null' ViewState, while we have
+something else. This is what should be fixed.
+
+Kosta
+
+On Sun, 24 Jun 2007 05:05:36 -0700, "Igor Zelmanovich" <igorz at mainsoft.com>
+scribbled:
+
+
+> Hi, Marek.
+Hello guys,
+
+> #78533 is not a bug.
+> 
+> MS behaves the same if you add some code which causes the 
+> usercontrol's saved viewstate to be not null.
+> In this case the Page cannot load viewstate properly and the Exception 
+> is thrown:
+> 
+> "Failed to load viewstate.  The control tree into which viewstate is 
+> being loaded must match the control tree that was used to save 
+> viewstate during the previous request.  For example, when adding 
+> controls dynamically, the controls added during a post-back must match 
+> the type and position of the controls added during the initial request. "
+> 
+> the sample works in .Net but not in MONO case implementation specific.
+> 
+> WebControl saves its ViewState into Pair instatnce always, and there 
+> is no valid scenario where LoadViewState will be called with 
+> dhttp://idea.opensuse.org/ifferent typeargument.
+> 
+> I sagest to revert the changes from r80368.
+The problem here is that we're not consistent in how we save the view state
+throughout various controls. Sometimes, internally, we use a Triplet and
+sometimes a Pair. So I thought that it would be best to handle the
+situation where the state is loaded. Note that the sample was failing when
+there was no control with saved data in the state yet, which is what works
+on MS.NET.
+If you feel there's a need to change the way we store/restore view state
+now, please file a bug - we're in the hack week now
+(http://idea.opensuse.org/), so I'll take a look at the issue next week :)
+
+best regards,
+
+marek


More information about the mono-bugs mailing list