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

Explain the difference between page.registerclientscriptblock and page.registerstartupscript?

1022


How does the iis work?

1038


Can you use Web API with ASP.NET Web Form?

1150


What types of data validation events are commonly seen in the client-side form validation?

976


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

994


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


If you are using two select queries and retrieving data. how do you access second query's result set using data reader?

5586


What is ispostback method in asp.net? Why do we use that?

1224


Explain http handlers? Where we can use the http handlers?

1241


What are Master Pages in ASP.NET? or What is a Master Page?

1132


How many ways are there to maintain a state in .net? What is view state?

1014


Where do the cookie state and session state information be stored?

930


Is it possible to write code in many languages in one asp.net project?

1026


Why is this service branded with windows livetm?

1078


What are the different types of events are occured when a client requests an ASP.NET page from IIS server?

1119