Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Andy B" <a_b...@sbcglobal.net> wrote in message news:u81MBQcq...@TK2MSFTNGP04.phx.gbl...
private MyClass myObject;
in the page class?
--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Andy B" <a_b...@sbcglobal.net> wrote in message
news:u81MBQcq...@TK2MSFTNGP04.phx.gbl...
//Once the ContractManager is created, I now need to create the object
itself. This requires the following code which wont work inside a page class
since it is
//executable code. This is where I run into huge problems since the
following object needs to be accessible by all of the methods/event handlers
of the class during
//its entire lifecycle.
//This creates the object, assigns default values and returns a Contract
object and assigns it to StockContract.
Contract StockContract = Manager.CreateEmptyStockContract();
Hope this helps with what I need.
"Eliyahu Goldin" <REMOVEALLCAPIT...@mMvVpPsS.org> wrote in
message news:%23NgEg$dqIHA...@TK2MSFTNGP04.phx.gbl...
private Contract StockContract = Manager.CreateEmptyStockContract();
this will be available to all methods in the page class. if you need the
same instance on a postback, then you will need to come up up a way to
save/restore the object between postbacks. the session object can help here.
-- bruce (sqlwork.com)
Doesn't actually work in just a class. I get a compiler error saying that
this statement is invalid unless inside a method of some kind. I will need
the StockContract object available to all methods/event handlers and it will
have to be around during postbacks.
"bruce barker" <bruce...@discussions.microsoft.com> wrote in message
news:86ECEC89-012B-4656...@microsoft.com...