can we transfer data from one page to another page using
viewstate if so how?if not y?

Answer Posted / vijaykumar

Yes.
View state is page specific; it contains information about
controls embedded on theparticular 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 thepage and its PostBackUrl property is
set to a non-null value. This field contains the viewstate
information of the poster page. To access the view state of
the poster page, you canuse 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 =(Label)poster.findControl("myLabel");
string lbl = posterLabel.Text;

This cross-page post back feature also solves the problem of
posting a Form to multiplepages, because each control, in
theory, can point to different post back URL.

Is This Answer Correct ?    41 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

if i want to give an alert message like "try after sometime" to a web page which is being seen by other person.if a web page is not seen by anyone then it should display otherwise it show a display a message stating that other person is viewing so try after some time........how can i implement this.

1831


i develop a web application and i gave security setting i.e autherization and athentication now it work properly on my local system , now question is ,is this security setting ie autherization and athentication which i gave in web.config will it be enough strong to secure my application on internet or i have to use some 3rd party tool or software to get security .if yes --how ? if no--what is the alternate?

1507


What is asp.net? How is it different from asp?

540


Are cookies client side or server side?

494


Differentiate strong typing and weak typing

524






Explain the advantages of passport authentication.

509


a)COM Callable Wrapper b)Runtime Callable Which one of the above is Win32 API in .Net?

1590


hi .net gurus. plz if any one has dumps on 70-631 and 70-541 on windows sharepoint services kindly mail me.

1263


What is data binding in asp net?

586


What’s the difference between response .redirect and server.transfer?

510


how to elimainte the similar data from the different tables

1704


Why session is necessary in web application?

509


What are the steps involved to fill a dataset?

550


Explain the difference between webfarm and webgardens in .net?

541


Explain in what order a destructors is called.

575