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
To bind columns manually which tags do you need to add within the asp:datagrid ?
Which of the following .NET framework supports Web API?
Explain the reason why the javascript validation not run on the asp.net button but run successfully on the html button?
Give an example of cookie abuse.
What are the versions of garbage collection?
Why mvc is faster than asp.net? : Asp.Net MVC
Name the two properties are on every validation control?
Do you support digital rights management to protect my videos?
How to handle errors in Web API?
What is an example of an application service provider?
What is application in asp net?
Is razor a programming language?
What is server redirect?
How do we implement bundling in MVC?
Differentiate between authentication and authorization.