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
In a page I have gridview with options of select and delete using hyperlink when I am selecting any one of then it has to open another page how can it?
What is the difference between c# and .net?
What is repository pattern in mvc.net? : asp.net mvc
Less than one page, how many windows will you be able to maintain?
In which event of the page life cycle, is the viewstate available?
Is there any alternative to avoid name collisions other then Namespaces?
What are the events in a page life cycle?
How does ASP.NET framework maps client side events to Server side events.?
Write some code using interfaces, virtual methods, and an abstract class`
What is runat?
Suppose You Want A Certain Asp.net Function Executed On Mouseover For A Certain Button. Where Do You Add An Event Handler?
What are different methods of session maintenance in asp.net?
Differentiate between structure and class.
What are the session variables?
Explain about solution explorer window?