Author: IMSScott | Posted on: 10/4/2008 3:01:44 PM | Views : 612

I have a web user control with a multi-view in it which has programmatically generated views populating it, filled in the control Init procedure.  Although it is recommended that Views be populated in Pre_Init, web user controls don't have a pre_init, and I found someone else doing it succesfully in page_load, so I tried it and it works just fine.

 However, I need to nest this control inside another web user control, and that's when the problems start.  It loads normally, and when I navigate to the first view, it displays the contents of that view normally, but if I try to move to any other View by incrementing or decrementing the ActiveViewIndex, I get the message "ActiveViewIndex is being set to '0'.  It must be smaller than the current number of View controls '0'. For dynamically added views, make sure they are added before or in Page_PreInit event.
Parameter name: value "  I should mention that the ...

Go to the complete details ...