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
What is a server farm in iis?
What are the different web pages?
Is there any limit for query string? Means what is the maximum size?
What is Partial PostBack in ASP.NET?
Difference between DataGid and Girdview? Difference b/w .Net 2.0, 3.0 and 3.5 ? Diff b/w dispose & Finialize Methods?
What is caching? Explain.
Is asp.net outdated?
What asp.net control can embed xaml into asp.net pages?
What is the difference between ASP Session State and ASP.Net Session State?
What is the basic difference between asp and asp.net?
What is a web api endpoint?
Is it possible for me to change my aspx file extension to some other name?
How many types of file extensions for razor views in ASP.Net MVC?
What is intrinsic objects in asp.net?
How does a web application session work?