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
Is it possible to write code in many languages in one asp.net project?
Why session is necessary in web application?
What is the default timeout for a cookie?
Can I have a unique key as foreign key?
Define reflection in .net?
Define the term Scavenging in Caching?
What is caching? Explain.
Which .NET framework supports Web API?
What is the concept of postback in asp.net?
Define static member?
What is asp.net mvc? : asp.net mvc
How does windows service lifecycle differ from a .standard. Exe?
1.can we add connection string in global.asax?????????? 2.what are the default files included when we create new web application????
What is Web API?
i want to implement grid view value in paypal site. so how to create this code in asp.net with C#