Welcome Guest Search | Active Topics | Sign In | Register

Error with RadioButtonList in CallbackPanel Options
Gunnar
Posted: Sunday, July 19, 2009 12:25:41 PM
Rank: Member
Groups: Member

Joined: 7/17/2009
Posts: 17
I have a RadioButtonList contained in a CallbackPanel. The RadioButtonList has "AutoPostBack=true".

When I change the state of the RadioButtonList (i.e. select a new choice), I get the following error message:

Code: HTML/ASPX
[Exception: Object 'System.String[][]' can not be serialized because type 'System.String[][]' is not supported.]
   EO.Web.Internal.dz.a(Object A_0) +396
   EO.Web.Internal.dz.a() +339
   EO.Web.Internal.e4.c() +218
   EO.Web.Internal.du.c() +182
   EO.Web.Internal.du.c() +143
   EO.Web.Internal.du.c() +143
   EO.Web.WebControlBase.u() +94
   System.Web.UI.Control.SaveViewStateRecursive() +187
   System.Web.UI.Control.SaveViewStateRecursive() +106
   System.Web.UI.Control.SaveViewStateRecursive() +106
   System.Web.UI.Control.SaveViewStateRecursive() +106
   System.Web.UI.Control.SaveViewStateRecursive() +106
   System.Web.UI.Control.SaveViewStateRecursive() +106
   System.Web.UI.Control.SaveViewStateRecursive() +106
   System.Web.UI.Control.SaveViewStateRecursive() +106
   System.Web.UI.Page.SaveAllState() +168
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1099



Is this a problem with CallbackPanel or is it something else?

Gunnar
Posted: Sunday, July 19, 2009 12:46:51 PM
Rank: Member
Groups: Member

Joined: 7/17/2009
Posts: 17
Sorry, probably not RadioButtonList. I changed to a set of RadioButtons instead, and got the same problem.

I have a TreeView on the same CallbackPanel, but I assumed that this control wouldn't cause any problem. But when I set visible=false on the TreeView I get rid of the error message...

When the TreeView is visible, it looks OK, but the postback fails...
eo_support
Posted: Monday, July 20, 2009 7:51:31 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Can you provide a test page that duplicates the error? We are not able to reproduce the problem here.

Thanks!
Gunnar
Posted: Monday, July 20, 2009 10:31:21 AM
Rank: Member
Groups: Member

Joined: 7/17/2009
Posts: 17
Hi,

After having dissected my program down to atoms and rebuilt it again, I've come to the conclusion that the problem was based on ViewState inconsistency.

I have a dynamically build TreeView in a dynamically loaded UserControl, and the ViewState got out of sync. I think that was the root cause for the error situation.

After much Internet browsing and many changes I now think that I have solved the problem. After some advanced tweaking of the OnInit() and CreateChildControls() on the UserControl and OnInit() and UserControl loading in the master page I finally got it to work. (...so far...)

Angel
eo_support
Posted: Monday, July 20, 2009 10:34:14 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Yes. ViewState inconsistency can cause such problems for you. Glad that you found out and thanks for the update!
Gunnar
Posted: Tuesday, July 21, 2009 4:08:17 AM
Rank: Member
Groups: Member

Joined: 7/17/2009
Posts: 17
Well, it seems that there still are some issues with this one. I have some kind of problem with EO TreeView and I guess it could be ViewState related...or something....

I know that you want test pages to verify the things, but it will quite some job to extract a functional test page so I'd appreciate if we could have a discussion first...

The setup:

*One page with a panel control into which a dynamic UserControl is loaded. (...no CallbackPanel, only standard panels with full page refresh...)
*The dynamic UserControl include some dynamically populated controls, let's restrict the configuration to a EO Treeview and a standard TreeView.
* The UserControl is loaded into the panel when a button is clicked, and then reloaded in the Page_Load method on postbacks (retaining the same ID).
* The TreeView objects in the ascx file are empty, i.e. without child nodes.
* The node objects of the TreeViews are created in the Page_Init() method of the UserControl.
* The node configuration (expanded nodes, checkbox states) is set in the Page_Load() method of the UserControl.

Now, let's assume that I click the button to get the UserControl loaded. It loads and present the two TreeViews. Let's assume that the Page_Load() has expanded the first top node and selected the checkbox on the first child node (on both TreeViews).

I now make some change to the TreeViews (expand/compress nodes or change checkbox states) and initiates a postback (...let's assume I have another button for this...).

When the page is refreshed, the standard TreeView has the changed state while the EO TreeView has reverted to the initial state of expanded nodes and checkbox states. I make new changes to both TreeViews and initiates a new postback. When the page is refreshed, both TreeViews has the changed state.

So, that wrap things up - With a dynamically populated EO TreeView on a dynamically loaded UserControl, the EO TreeView reverts to the initial state on the first postback, and only on the first postback. On subsequent postbacks, it retains the configuration as set by the user.

Standard dynamically created controls (TreeView and RadioButtoList tested) work on the first postback as well as on subsequent postbacks.

Help Think
eo_support
Posted: Tuesday, July 21, 2009 7:44:19 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Try to move the code that reloads the user control from Page_Load to Page_Init. Page_Load occurs after the control finish loading state information, which is too late because the control needs to be there in order to load state information. If this does not solve the problem, we do need a test project.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.