L
lisa
Every book and every website I've seen that talks about how to save
state for child controls in a composite webcontrol says to do something
like the following. But when I do it, I hit the line:
Dim myState As Object() = CType(savedState, Object())
....and I get this error:
Cannot convert to 'Object ()'.
I get the same error when I type in ?CType(savedState, Object()) in the
command window. It's driving me buggy (no pun intended). I checked to
see if savedState is Nothing, and it isn't.
What's going on? I can't be the only one who has run into this, but
everyone seems to just assume that it'll work.
Thanks!
Lisa
Protected Overrides Sub LoadViewState(ByVal savedState As Object)
If Not savedState Is Nothing Then
Dim myState As Object() = CType(savedState, Object())
If Not myState(0) Is Nothing Then
MyBase.LoadViewState(myState(0))
If Not (myState(1) Is Nothing) Then CType(_LeftList,
IStateManager).LoadViewState(myState(1))
If Not (myState(2) Is Nothing) Then CType(_RightList,
IStateManager).LoadViewState(myState(2))
If Not (myState(3) Is Nothing) Then CType(_MoveLeft,
IStateManager).LoadViewState(myState(3))
If Not (myState(4) Is Nothing) Then CType(_MoveRight,
IStateManager).LoadViewState(myState(4))
End If
End Sub 'LoadViewState
state for child controls in a composite webcontrol says to do something
like the following. But when I do it, I hit the line:
Dim myState As Object() = CType(savedState, Object())
....and I get this error:
Cannot convert to 'Object ()'.
I get the same error when I type in ?CType(savedState, Object()) in the
command window. It's driving me buggy (no pun intended). I checked to
see if savedState is Nothing, and it isn't.
What's going on? I can't be the only one who has run into this, but
everyone seems to just assume that it'll work.
Thanks!
Lisa
Protected Overrides Sub LoadViewState(ByVal savedState As Object)
If Not savedState Is Nothing Then
Dim myState As Object() = CType(savedState, Object())
If Not myState(0) Is Nothing Then
MyBase.LoadViewState(myState(0))
If Not (myState(1) Is Nothing) Then CType(_LeftList,
IStateManager).LoadViewState(myState(1))
If Not (myState(2) Is Nothing) Then CType(_RightList,
IStateManager).LoadViewState(myState(2))
If Not (myState(3) Is Nothing) Then CType(_MoveLeft,
IStateManager).LoadViewState(myState(3))
If Not (myState(4) Is Nothing) Then CType(_MoveRight,
IStateManager).LoadViewState(myState(4))
End If
End Sub 'LoadViewState