How to access view state value of the page in the next page?, DOT NET Programming

How do we access view state value of the page in the next page?

The View state is page specific; it contains information about controls embedded at the particular page. ASP.NET 2.0 solves this by embedding a hidden input field name, __POSTBACK. This field is then embedded only when there is an IButtonControl on the page and its PostBackUrl property is set to a non-null value. This field contains the view of state information of the poster page. To access this view state of the poster page, you can use the new PreviousPage property of the page:

Page poster = this.PreviousPage;

Now  you can find any control from the previous page and see  its state:

Label posterLabel = poster.findControl("myLabel");

string lbl = posterLabel.Text;

This cross-page post back facility also solves the problem of posting a Form to multiple pages, as  each control, in theory, can point to different post back URL.

Posted Date: 9/22/2012 1:10:22 AM | Location : United States







Related Discussions:- How to access view state value of the page in the next page?, Assignment Help, Ask Question on How to access view state value of the page in the next page?, Get Answer, Expert's Help, How to access view state value of the page in the next page? Discussions

Write discussion on How to access view state value of the page in the next page?
Your posts are moderated
Related Questions
Automate installation setup Project Description: The steps are: Clicking four times accept and the setup goes to tray, I do not want to block the mouse or the keyboard. Sk

What is Full Trust? Your code is permitted to do anything in the framework, meaning that all (.Net) permissions are granted. The GAC has Full Trust because it's on the local HD


I need a program that mimics the similar functionality as the link below. Program must have a unique user interface. Must add source code, installer, and of course a nice user i

What is the difference between Authentication and authorization? This is  a tricky question. These two concepts seem altogether same  but there is big  difference. The Authenti

Explain collation sequence in sql server. The Collation sequences are the set of rules which determine how the data is sorted and compared. The Sorting rules can be defined wit

What is difference between SITP and UTP in testing? The Unit Test Plan (UTP) are completed at smallest unit level or stand alone mode. For example you have Customer and invoici

Our company is seeking a talented PHP Developer to join our young and dynamic online media agency. Must have: - Knowledge in SQL and Databases, proven indexing and coding exp

What is an identifier? Identifiers are northing but names given to various entities uniquely identified in a program. The name of identifiers must vary in spelling or casing. F

What is a class? A class explains all the attributes of objects, as well as the methods that execute the behavior of member objects. It is a comprehensive data type, which show