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 ? 7 3012
> 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.
Is there something similar to HttpContext.Current.Session that allows a business object to access the current Session ?
System.Web.HttpContext.Current.Session
--
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 ?
> 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.
Is there something similar to HttpContext.Current.Session that allows a business object to access the current Session ?
System.Web.HttpContext.Current.Session
--
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 ?
"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 ?
"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 ?
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 ?
ViewState is still inaccessible due to its protection level I'm afraid.
"Kevin Spencer" <ke***@takempis.com> wrote in message
news:e2**************@TK2MSFTNGP09.phx.gbl... 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 ? > >
Oh yes, that is correct. You would have to expose the ViewState via a public
property in the Page in order to access it from another class.
--
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:OH**************@tk2msftngp13.phx.gbl... ViewState is still inaccessible due to its protection level I'm afraid.
"Kevin Spencer" <ke***@takempis.com> wrote in message news:e2**************@TK2MSFTNGP09.phx.gbl... 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 ? > > > > > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: John Kirksey |
last post by:
I have a page that uses an in-place editable DataGrid that supports sorting and paging. EnableViewState is turned ON. At the top of the page are several search fields that allow the user to filter...
|
by: Steve Drake |
last post by:
All,
I have a CONTROL that contains 1 control (Control ONE), the 1 control that
it can contain 1 or 2 control (Control A and B).
Control A, raises and event and Control ONE receives this event...
|
by: neo |
last post by:
hi,
I am studying ASP.NET and have few questions -
1) The session ID and values of controls is stored in VIEWSTATE
variable. So now when we put EnableViewState="false" in Page directive and...
|
by: Simon |
last post by:
Hi everyone,
I have a quick question that I hope someone can help me with:
I've made a user control that contains a text box and some validation
functionality. This control has a few extra...
|
by: et |
last post by:
I'm not sure I understand the use of the ViewState.
Do I understand correctly that values of controls are automatically held in
a hidden control called ViewState?
If so, then why can't we get...
|
by: RCS |
last post by:
I have an app that I have different "sections" that I want to switch back
and forth from, all while having the server maintain viewstate for each
page. In other words, when I am on Page1.aspx and...
|
by: Mark Broadbent |
last post by:
Been a while since I've touched asp.net but one thing that always seems to
fustrate me is the loss of state on variable declarations. Is there anyway
(i.e. assigning an attribute etc) to instruct...
|
by: hitendra15 |
last post by:
Hi
I have created web user control which has Repeater control and
Linkbutton in ItemTemplate of repeater control, following is the code
for this control
On first load it runs fine but when...
|
by: paul.hester |
last post by:
Hi all,
Does anyone know why the ViewState would be empty?
When I'm receiving a postback, I can access a posted value using
controlName.Value but not ViewState.
I have EnableViewState set...
|
by: Nick C |
last post by:
Hi
How can i reduce the viewstate for my asp.net application. It is getting
very large now. What is a good solution?
thanks
N
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
| |