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?



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

Answer / 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

More ASP.NET Interview Questions

Which class provides methods that can be used to manage role membership to be used in user authorization?

3 Answers   Wipro,


Which property needs to be set for script manager control to extend the time before throwing time out expection if no response is received from the server?

0 Answers  


What are the types of validation in asp net?

0 Answers  


Using Statement usage in C#

2 Answers  


How many web.config files can I have in an application?

0 Answers  


how to stop cookie in particular page using asp.net

2 Answers   CGI,


in which protocol ASP.NET WEB API Work?

0 Answers   HCL,


Explain repository pattern in asp.net mvc? : asp.net mvc

0 Answers  


Can we throw exception from catch block ?

4 Answers   Accenture, BirlaSoft,


What is content place holder?

0 Answers  


Contrast the use of an abstract base class against an interface?

5 Answers   iLink,


What is the difference between client-side and server-side validations in ASP.NET?

0 Answers   Sans Pareil IT Services,


Categories