Ah, sorry. It's early. That would be
CType(System.Web.HttpContext.Current.Handler, System.Web.UI.Page).ViewState
(VB.Net)
- or -
((System.Web.UI.Page) System.Web.HttpContext.Current.Handler).ViewState (C#)
Note that this only makes the Page ViewState available. Each Control in the
Page has its own ViewState as well.
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
"JezB" <je*************@blueyonder.co.yk> wrote in message
news:Ow**************@TK2MSFTNGP12.phx.gbl...
"Kevin Spencer" <ke***@takempis.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl... How can I get to a page's ViewState from inside a business object ? I
have a reference to the calling page but the ViewState property of the
Control class is protected.
Accessing private members from one class to another can be done by means
of creating public properties and methods that make changes to private
members from the inside.
I may have to resort to that, tho its not my ideal solution.
Is there something similar to HttpContext.Current.Session that allows
a business object to access the current Session ?
System.Web.HttpContext.Current.Session
No that's the same thing ! I meant something SIMILAR to this that would
let me get at ViewState.
--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
"JezB" <je*************@blueyonder.co.yk> wrote in message
news:ud**************@TK2MSFTNGP09.phx.gbl... How can I get to a page's ViewState from inside a business object ? I
have a reference to the calling page but the ViewState property of the
Control class is protected.
Is there something similar to HttpContext.Current.Session that allows
a business object to access the current Session ?