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

How many types of file extensions for razor views in ASP.Net MVC?

1344


What is role-based security in asp.net?

1148


Explain diff. Between friend and protected friend?

989


How to implement Authentication and Authorization?

1114


Define xmlvalidatingreader class.

1136


Explain the flow of processing of the request? : asp.net mvc

1021


How you can add an event handler?

1019


Is asp.net and .net are same or different?

1041


What’s the difference between asp.net web forms and asp.net mvc?

1245


How can you access the properties and controls of master pages from content pages?

1056


What is the use of HttpHandlers? When to use this?

1148


How to unit test Web API?

1255


How to make paging concepts in datagrid in ASP.NET?

1080


Can you set the session out time manually?

936


What is meant by server side scripting?

1010