Passing objects

  • Thread starter Thread starter Iyigun Cevik
  • Start date Start date
I

Iyigun Cevik

I'm passing my form to another page by using Server.Transfer method. I wrote
readonly properties for each textbox in the first page, and i'm getting
values of these textboxes from second page from Context.Handler.

My problem is: I want to pass some other objects and some other values which
doesn't exist in the form. I know that i can make hidden field and pass
other values by them. But I can't pass an object in this way. Is there any
way to pass an object to another page or to PostBack?
Iyigun
 
Hi Iyigun

you can use the Cache, the Applicatio or the Session
variables to store objects for different forms:

Example:

(Save)
Page.Session.Add("MyObject", myObject)

(Load)
myObject = Page.Session.Item("MyObject")

May be necessary to use CType!
CType(Page.Session.Item("MyObject"),myObject)

HTH

Jenny
-----Original Message-----
I'm passing my form to another page by using
Server.Transfer method. I wrote
 
Back
Top