can we transfer data from one page to another page using
viewstate if so how?if not y?
Answer Posted / kranthi
Yes it is possibel!!!!!!!!!!!!
in pag1.aspx
protected void Button1_Click(object sender, EventArgs e)
{
ViewState["name"] = txtTest.Text;
Server.Transfer("Default2.aspx");
}
In page2,aspx load event
protected void Page_Load(object sender, EventArgs e)
{
Page Poster = this.PreviousPage;
TextBox txtNewTest = (TextBox)Poster.FindControl
("txtTest");
string sDisplay = txtNewTest.Text.ToString();
Response.Write(sDisplay);
}
| Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
What are the server controls in asp.net?
What are server objects?
A Web Service Can Only Be Written In .net. Is it True??
Explain how is the asp.net mvc architecture different from others? : asp.net mvc
Explain the page lifecycle of an asp.net mvc? : asp.net mvc
What is the difference between mvc (model-view-controller) and mvp (model-view-presenter)? : asp.net mvc
Explain the use of errorprovider control in .net?
Can we override the enablepartialrendering property of the scriptmanager class?
What is the function used for removing an event listener?
What is GAC in ASP.NET 2.0
Is asp.net web forms dead?
What threading model used in asp and asp.net?
Dataset is the disconnected environment. suppose if you are binding records to gridview (disconnected environment) and you are making changes to the the grid but before updating the database if any other user modify the data, how will you avoid such problem?
What do you mean by caching in asp.net?
From which base class all web forms are inherited?