Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / alb.shah

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 ?    10 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the behavior of a Web browser when it receives an invalid element?

1109


Suppose you want an asp.net function (client side) executed on the mouseover event of a button. Where do you add an event handler?

1032


can we remote debug applications with the remote debugger installed with vs.net 2002, with vs.net 2003?

2147


How you can stop the validation of ASP.NET controls from client side?

1037


What are validator? Name the validation controls in asp.net?

1014


How does u call and execute a sp in .net?

992


What is difference between web api and web services?

1002


What are strong names?

1038


Explain model, view and controller represent in an mvc application? : asp.net mvc

933


How asp.net mvc differs from asp.net web forms? : asp.net mvc

1091


How can we identify that the Page is Post Back?

985


What is http pipeline in asp.net?

977


What is the difference between visual basic and asp.net?

1046


what are the security certificates used in webservices?

2011


How is mvc different from asp.net? : Asp.Net MVC

1048