can we transfer data from one page to another page using
viewstate if so how?if not y?

Answer Posted / jack

TRY THIS it Will WORK



public void Button1_Click(object sender, EventArgs e)
{
ViewState["name"] = TextBox1.Text;
Context.Items.Add("variable", ViewState["name"].ToString());

Server.Transfer("Default2.aspx");
}
//next page

public void Page_Load(object sender, EventArgs e)
{
string myValue = Context.Items["variable"].ToString();
TextBox2.Text = myValue;
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you understand by aggregate dependency?

814


How to you can limit Access to Web API to Specific HTTP Verb?

915


How would you turn off cookies on a page of a website?

680


Is sql backend or frontend?

758


What are the disadvantages of asp.net?

808


How can we inherit a static member?

798


How to make sure that contents of an updatepanel update only when a partial postback takes place (and not on a full postback)?

726


Do session use cookies in asp net?

722


Where would you use an ihttpmodule, and what are the limitations of any?

775


How to create a db connection at one place/page so that we can use that connection for all pages/forms/windows.what r the steps ned to be performed if question not clear,let me know

910


Describe the difference between inline and code behind - which is best in?

776


What is a web api?

776


Difference between using directive vs using statement?

723


What is application in asp net?

683


Why Unload event of MasterPage Calls first in ASP.net ?

789