I am creating an ASPX application that collects data from the user can creates a file based on this data. Different types of data are collected based on the type of user. Also, I have to check the database to see if there is data already in the database. I am looking for an easy way to keep track of the data while traversing between all the ASPX pages that are collecting data. I know i can pass the data in the URL and if i don’t find an alternative method then i will use that.
My question is, is it possible put the data into a C# object and somehow pass the instance of that object between ASPX pages?
The simplest is to use the Session bag.
When retrieving an object from session state, cast it to the appropriate type.
Here’s a more exhaustive article on Session state on MSDN: http://msdn.microsoft.com/en-us/library/ms178581.aspx (from which the brief code examples are shamelessly copied)