Passing Classes from page to page *Resolved*
Hey everyone.... not much of a ASP.NET person so I gotta ask, how do I pass a class object from page to page (it basically contains all the data for a form that spans multiple pages)
I imagine I gotta use a session variable.... is this along the lines of correct?
dim myCls as new myClass("Hi","there")
dim MyCls2 as new myClass()
session.add("myCls", myCls)
myCls2 = session.item("myCls")
Edit: I was close
myCls2 = ctype(session.item("myCls"), myClass))
Re: Passing Classes from page to page
You can use either the Session or Application objects to store data. You could also serialize the class into XML and pass by querystring ;)
Re: Passing Classes from page to page
I figured it out how to pass via session. Not really interested in learning serialization and xml stuff this late in the game.
Re: Passing Classes from page to page
Only thing to bear in mind is that objects stored in the Session object are disposed of when that user's session expires. Around 20 minutes I think or something - I'm not 100% on that.
Object stored in the Application object however persist until the application itself is shutdown.
Re: Passing Classes from page to page *Resolved*
The server is configured so that the session should remain active as long as the user is view it (its an intranet webapp so we're not as concerned about the duration length)