Passing Objects

  • Thread starter Thread starter Jeremy
  • Start date Start date
It depends on what you are talking about here. In general, since HTTP is
stateless, the objects are destroyed when the page is finished with
processing. IN order to pull an object across pages, you generally will
shove the object into session. For app level variables, you can set it in
Application, or use static (Shared in VB.NET) variables.

Having said that, you should be specific about what you are trying to do, as
there are different possibilities depending on the form layout. For example,
if you want to handle form variables in another page after a
server.transfer, you can still pull from ViewState in most instances.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

**********************************************************************
Think Outside the Box!
**********************************************************************
 
By session variables.

Page 1:
myObject mobj = new myObject();
Session["mobj"] = mobj;

Page 2:
myObject mobj = (mobj)Session["mobj"];
 
Back
Top