EXPLAIN HOW TO ACCESS VIEWSTATE VALUE OF THIS PAGE IN THE NEXT PAGE.

Awadhendra Tiwari

Total Post:510

Points:2550
Posted by  Awadhendra Tiwari
 1703  View(s)
Ratings:
Rate this:
  1. Awadhendra Tiwari

    Post:510

    Points:2550
    Explain how to access ViewState value of this page in the next page.

    PreviousPage property is set to the page property of the next page to access the viewstate value of the page in the next page.
    Page poster = this.PreviousPage;
    Once that is done, a control can be found from the previous page and its state can be read.
    Label posterLabel = poster.findControl("myLabel");
    string lbl = posterLabel.Text;

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!