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
How you can return View from ASP.NET Web API method?
What are the advantages and disadvantages of Using Cookies?
Explain the benefits of viewstate?
Why mvc is faster than asp.net? : Asp.Net MVC
What are ASP.NET Web Forms? How is this technology different than what is available though ASP?
Differentiate between authentication and authorization.
How many types of cookies are available in asp?
Define resource files.
What are the advantages of using session?
Where code pages are used?
How many ways are there to maintain a state in .net? What is view state?
What's the ASP.Net Application life cycle?
Explain the page lifecycle of an asp.net mvc? : asp.net mvc
Explain parts of assembly?
How do I debug an asp.net application that was not written with visual studio.net and that does not use code-behind?