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
Explain the difference between page.registerclientscriptblock and page.registerstartupscript?
How does the iis work?
Can you use Web API with ASP.NET Web Form?
What types of data validation events are commonly seen in the client-side form validation?
How does u call and execute a sp in .net?
Suppose you want an asp.net function (client side) executed on the mouseover event of a button. Where do you add an event handler?
If you are using two select queries and retrieving data. how do you access second query's result set using data reader?
What is ispostback method in asp.net? Why do we use that?
Explain http handlers? Where we can use the http handlers?
What are Master Pages in ASP.NET? or What is a Master Page?
How many ways are there to maintain a state in .net? What is view state?
Where do the cookie state and session state information be stored?
Is it possible to write code in many languages in one asp.net project?
Why is this service branded with windows livetm?
What are the different types of events are occured when a client requests an ASP.NET page from IIS server?