|
-
Mar 23rd, 2005, 12:16 AM
#1
Thread Starter
Fanatic Member
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))
Last edited by Graff; Mar 23rd, 2005 at 12:45 PM.
If wishes were fishes we'd all cast nets.
-
Mar 23rd, 2005, 12:30 PM
#2
Retired VBF Adm1nistrator
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
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Mar 23rd, 2005, 12:36 PM
#3
Thread Starter
Fanatic Member
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.
If wishes were fishes we'd all cast nets.
-
Mar 23rd, 2005, 12:37 PM
#4
Retired VBF Adm1nistrator
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.
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Mar 23rd, 2005, 12:47 PM
#5
Thread Starter
Fanatic Member
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)
If wishes were fishes we'd all cast nets.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|