Pageflow userdata "The given key was not present in the dictionary"

Topics: Web Client Software Factory, UIP Application Block discussion, User Forum
Aug 20, 2007 at 3:50 AM
hi all,
below is my situation with pageflow of WCSF:
i got a controller with this property (VB.NET)

Public Property CallLogInfoCart() As CallLogInfoList
If Not CallLogStartPageFlow.UserData.Contains("CallLog") Then
CallLogStartPageFlow.UserData("CallLog") = New CallLogInfoList(Thread.CurrentPrincipal.Identity)
End If
Return CType(CallLogStartPageFlow.UserData("CallLog"), CallLogInfoList)
End Get
Set(ByVal value As CallLogInfoList)
CallLogStartPageFlow.UserData("CallLog") = value
End Set
End Property

this should be used inorder for user to Saving and Retrieving State
i got few states

CallLog ---- >AddCallLog.......>SaveCallLog.........>CompleteState

i made a button which triggers a activity which moved user from calllog state to AddCallog state.


which was then move to an addcalllog page. after inputting some data, after i pressed a button which trigger the activity which move use from addcalllog state back to calllog state


this was ok but when i want to retrieve the state(CallLogStartPageFlow.UserData.Contains("CallLog") )
it always gets the error "The given key was not present in the dictionary"

is there any thing i do wrong with the pattern of the pageflow? i seems to be able to CallLogStartPageFlow.UserData.Contains("CallLog") when i was in the CallLog state and unable to CallLogStartPageFlow.UserData.Contains("CallLog") when i was in addCallLog state....

anyone pls help

thx martin

Aug 20, 2007 at 3:57 AM
below is my addCallLog method, which calls the CallLogInfoCart() property

Public Sub AddCallLog()
Dim _CallLogInfoList As CallLogInfoList
Dim _CallLogInfo As New CallLogInfo
CallLogInfo.CallID = "111"
CallLogInfo.CaseNo = "222"
CallLogInfo.CatCode = "333"

_CallLogInfoList = CallLogInfoCart <-----------------HERE
End Sub

how some nice ppl can help

thx martin
Aug 21, 2007 at 5:34 AM
ooo i fixed the problem its my fault in the design of the pageflow which causes this.