Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6024433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:09:17+00:00 2026-05-23T04:09:17+00:00

[A]System.Collections.Generic.Dictionary 2[System.String,System.Collections.Generic.List 1[DisplayAllQuestionsTable]] cannot be cast to [B]System.Collections.Generic.Dictionary 2[System.String,System.Collections.Generic.List 1[DisplayAllQuestionsTable]]. Type A originates from

  • 0

[A]System.Collections.Generic.Dictionary2[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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T04:09:17+00:00Added an answer on May 23, 2026 at 4:09 am

    Try to get the type of the Session[“ThreadPage”] object:

    Session["ThreadPage"].GetType().ToString();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I ran into this today when unit testing a generic dictionary. System.Collections.Generic.Dictionary<int, string> actual,
I've got a System.Generic.Collections.List(Of MyCustomClass) type object. Given integer varaibles pagesize and pagenumber, how
Looking at System.Collections.Generic.Dictionary<TKey, TValue> , it clearly implements ICollection<KeyValuePair<TKey, TValue>> , but doesn't have
In other words, is it correct to use: public class CustomerList : System.Collections.Generic.List<Customer> {
I have a C# class the returns a List, using System.Collections.Generic Lists not F#
Previously, I had a class that wrapped an internal System.Collections.Generic.List<Item> (where Item is a
If i wish to put items into a System.Collections.Generic.Dictionary , I can either Add
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace GenericCount { class Program {
using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Text; namespace ConsoleApplication1 { public
I'm creating a class named TetraQueue that inherits System.Collections.Generic.Queue class overriding the Dequeue method,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.