How do we access viewstate value of this page in the next page
How do we access viewstate value of this page in the next page ?
View state is page specific; it contains information about controls embedded on the
particular page. ASP.NET 2.0 resolves this by embedding a hidden input field name,
__POSTBACK . This field is 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
state information of the poster page. To access the view state of the poster page, you can
use the new PreviousPage property of the page:
Page poster = this.PreviousPage;
Then you can find any control from the previous page and read its state:
Label posterLabel = poster.findControl("myLabel");
string lbl = posterLabel.Text;
This cross-page post back feature also solves the problem of posting a Form to multiple pages, because each control, in theory, can point to different post back URL.
2007-10-23, 4617👍, 0💬
Can Java object be locked down for exclusive use by a given thread? Yes. You can lock an object by p...
What are the different storage classes in C? C has three types of storage: automatic, static and all...
.NET INTERVIEW QUESTIONS - What is COM ? Microsoft’s COM is a technology for component software deve...
How To Divide Query Output into Groups? - MySQL FAQs - SQL SELECT Query Statements with GROUP BY You...
How To Decrement Dates by 1? - MySQL FAQs - Introduction to SQL Date and Time Handling If you have a...