The ReportInfo is a structure. The structure works fine on one web page but I am trying to use it on another web-page. Here is where I saved the ReportInfo structure to the Session Variable
Session[“ReportInfo”] = reportInfo;
On the other web-page, I re-created the Structure and then assign the session variable to it, like this…
reportInfo = (ReportInfo)(Session[“ReportInfo”]);
I get the following run-time error:
System.InvalidCastException was unhandled by user code
Message=”Specified cast is not valid.”
Source=”App_Web_-s8b_dtf”
How do I get the ReportInfo structure out of the Session variable to use again?
Have you checked the value of
Session["ReportInfo"]? Perhaps it’snullor some other unsavory value? Also, I assumereportInfoin the second page is of typeReportInfo?