[Mono-bugs] [Bug 557223] New: System.InvalidCastException after second postback on a customize control.

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Nov 20 09:06:45 EST 2009


http://bugzilla.novell.com/show_bug.cgi?id=557223

http://bugzilla.novell.com/show_bug.cgi?id=557223#c0


           Summary: System.InvalidCastException after second postback on a
                    customize control.
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.4.x
          Platform: x86-64
        OS/Version: RHEL 5
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.Web
        AssignedTo: mhabersack at novell.com
        ReportedBy: stefano.sapienti at apsystems.it
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Created an attachment (id=328691)
 --> (http://bugzilla.novell.com/attachment.cgi?id=328691)
Test Case

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.15)
Gecko/2009101601 Firefox/3.0.15 (.NET CLR 3.5.30729)

Adding controls and setting styles, in a particular way, to datagrid pager,
inheriting the control from base dataGrid, ends in a
System.InvalidCastException during second postback, when it's rebuilt from
viewstate.
It seems to be a very singular issue, I was not able to reproduce the error
using other types of controls, but maybe it can be a general problem so I
decided to report. 

Reproducible: Always

Steps to Reproduce:
1. Use the attached files to create a webapp that reproduce the problem
2. Click on linkbutton, the datagrid is shown.
3. Clink on a link of your choice.

Actual Results:  
System.InvalidCastException: Cannot cast from source type to destination type.
  at System.Web.UI.StateBag.LoadViewState (System.Object savedState) [0x00007]
in
/usr/src/packages/BUILD/mono-2.4.2.3/mcs/class/System.Web/System.Web.UI/StateBag.cs:85 
  at System.Web.UI.Control.LoadViewState (System.Object savedState) [0x00006]
in
/usr/src/packages/BUILD/mono-2.4.2.3/mcs/class/System.Web/System.Web.UI/Control.cs:891 
  at System.Web.UI.Control.LoadViewStateRecursive (System.Object savedState)
[0x00033] in
/usr/src/packages/BUILD/mono-2.4.2.3/mcs/class/System.Web/System.Web.UI/Control.cs:1686 
  at System.Web.UI.Control.LoadViewStateRecursive (System.Object savedState)
[0x000a2] in
/usr/src/packages/BUILD/mono-2.4.2.3/mcs/class/System.Web/System.Web.UI/Control.cs:1700 
  at System.Web.UI.Control.LoadViewStateRecursive (System.Object savedState)
[0x000a2] in
/usr/src/packages/BUILD/mono-2.4.2.3/mcs/class/System.Web/System.Web.UI/Control.cs:1700 
  at System.Web.UI.Control.LoadViewStateRecursive (System.Object savedState)
[0x000a2] in
/usr/src/packages/BUILD/mono-2.4.2.3/mcs/class/System.Web/System.Web.UI/Control.cs:1700 
  at System.Web.UI.Control.LoadViewStateRecursive (System.Object savedState)
[0x000a2] in
/usr/src/packages/BUILD/mono-2.4.2.3/mcs/class/System.Web/System.Web.UI/Control.cs:1700 
  at System.Web.UI.Control.LoadViewStateRecursive (System.Object savedState)
[0x000a2] in
/usr/src/packages/BUILD/mono-2.4.2.3/mcs/class/System.Web/System.Web.UI/Control.cs:1700 
  at System.Web.UI.Control.LoadViewStateRecursive (System.Object savedState)
[0x000a2] in
/usr/src/packages/BUILD/mono-2.4.2.3/mcs/class/System.Web/System.Web.UI/Control.cs:1700 
  at System.Web.UI.Page.LoadPageViewState () [0x00046] in
/usr/src/packages/BUILD/mono-2.4.2.3/mcs/class/System.Web/System.Web.UI/Page.cs:1926 
  at System.Web.UI.Page.RestorePageState () [0x00051] in
/usr/src/packages/BUILD/mono-2.4.2.3/mcs/class/System.Web/System.Web.UI/Page.cs:1558 
  at System.Web.UI.Page.InternalProcessRequest () [0x001b9] in
/usr/src/packages/BUILD/mono-2.4.2.3/mcs/class/System.Web/System.Web.UI/Page.cs:1533 
  at System.Web.UI.Page.ProcessRequest (System.Web.HttpContext context)
[0x0005b] in
/usr/src/packages/BUILD/mono-2.4.2.3/mcs/class/System.Web/System.Web.UI/Page.cs:1353 


Expected Results:  
It should run.
If you comment out Attributes.Add or Controls.AddAt or both and redo from point
1, it runs.

It runs on Mono 2.0.1

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list