Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to pass an object from one page to another

Status
Not open for further replies.

novice2002

Programmer
Feb 18, 2002
10
0
0
TT
hell0
i wolud like to know how (if possible ) to pass an object (say clsupload) from one page to another?
thanks for any help
 
well you must tell use what clsupload is? Is it a string or what? One way you can do this is through the link.

mypagetogoto.asp?query=<%= clsupload %>


Then on the page mypagetogoto.asp you can do this

clsupload = Request.QueryString(&quot;query&quot;)

Response.write(clsupload)

-Jason
 
You can't pass an object to another page via querystring or post.

The only way is to put it into a session variable, and then pick it up on the next page, but this is not good practice. On a high traffic site, this severely inhibits server performance. Best to pass pertinent information (simple variables) via querystring or get so that the object can be rebuilt on subsequent pages.

:)
paul
penny1.gif
penny1.gif
 
There are two options to migrating an Object from one pageto another...

1. Server.Transfer will transfer information and variables from one page to another. It is better to use that Response.Redirect because it does not round trip. But only works when you do need to use the same variables on another page. This will not allow you necessarily to show the page to the user. This is usually for extra processing.

2. The other developer, stating the Session Object was corect. You can use the session Object, but it is costly in high traffic situations. My option for this would be to break the Object down into its separate parts, as strings and other smaller datatypes, and then store it in a Session. Or instead of using the Session that comes with IIS, you could store information in a database session. There is a component you can download free for 30 days that shows exactly how to do this.

Look at this article.

It may help you.

Good Luck...

Osie Brown
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top