Thursday, 28 March 2013

Access Viewstate Value On Different aspx Page

Kailash ChandelViewstate is used for state management in on same page. We can also access the Viewstate on other aspx page. For this we need to use server.transfer() method instead of response.redirect() method to redirect to the other page.

Let us have an aspx page named passviewstate.aspx . We will store two viewstates here as follow:

view state

And use server.transfer to redirect to another page named readviewstate.aspx .  We need to place a fuction of statebag class.


Now we will read these viewstate values on the page  readviewstate.aspx . For this we will create a function to read the the previous page's viewstate.

After creating the above function we will write code to show the viewstate values.

And we are done. Now we the values of two viewstate variables Name and Organisation in the labels lblMessage and lablOrganisation.

Blockchain Technology : Smart Contracts

Origin of Smart Contract Smart contract concept was developed by "Nick Szabo" in 1994 with the goal of bringing practices of...