CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> .NET

 ViewState

Print topic Send  topic

Author Message
Tuong Do
Posted: 11/02/2006, 2:34 AM

Hi
Can anyone please tell me the full path of the ViewState

eg
System.Path.ViewState("test") = "test value"

Stan
Posted: 11/02/2006, 6:46 AM

What you mean under "path"? ViewState is protected property of any control in ASP.NET. It is return the instance of the System.Web.UI.StateBag class

Stan
Tuong Do
Posted: 11/02/2006, 2:55 PM

For example when you try to access
Session("ID") = "1"

The full path to the session is

System.Web.HttpContext.Current.Session


"Tuong Do" <tuongdo@hotmail.com> wrote in message
news:eichk2$q2$1@news.codecharge.com...
> Hi
> Can anyone please tell me the full path of the ViewState
>
> eg
> System.Path.ViewState("test") = "test value"
>

Stan
Posted: 11/03/2006, 12:37 AM

This is not a full path - this is only a one of methods to obtain the reference on the HttpSession instance, associated with Http request. And it is possible since Session is singleton public instance for each request. HttpContext.Current return the reference on instance of HttpContext - class that encapsulates all info about current request - session state, request and response instances, security information and so on.

There is no analog for ViewState, since ViewState is a protected non-static member of the Control class. Therefore it is accessible from the class member's code only.
If you want to pass info from ViewState to the outside code which haven't access to the necessary instance of ViewState you should use some available to all store - such as Session or HttpContext.Items

Stan

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.