[A]System.Collections.Generic.Dictionary
2[System.String,System.Collections.Generic.List1[DisplayAllQuestionsTable]]
cannot be cast to
[B]System.Collections.Generic.Dictionary2[System.String,System.Collections.Generic.List1[DisplayAllQuestionsTable]].
Type A originates from ‘mscorlib,
Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089’ in
the context ‘LoadNeither’ at location
My Dictionary syntax:
Dictionary<string, List<DisplayAllQuestionsTable>> tPages=tPages =
new Dictionary<string, List<DisplayAllQuestionsTable>>();
When i try to retrieve it from Session:
tPages = (Dictionary<string, List<DisplayAllQuestionsTable>>)Session["ThreadPage"]; // i get an exception here
Unable to cast object of type [
System.String
,System.Collections.Generic.List1[DisplayAllQuestionsTable]]' to type '**System.Collection**s.Generic.Dictionary2
Try to get the type of the Session[“ThreadPage”] object: