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

Is LINQ performance wise better or using sqlcommand?

4691


How many types of cookies are there in asp.net?

758


What are the different properties of server control that exists?

818


What is session and application variable in asp net?

686


I am trying to implement sorting facility from client side code in GridView Control. So how can I fill up an Array inside client side code (using JavaScript), i want to assign my DataSet object declared and filled up on Server side(in code behind) to the array (on client side)

1770


What is a 401 redirect?

726


What is the difference between session.abandon() vs clear()?

768


If you want to write your own dot net language, what steps you will you take care?

749


What is the use of global.asax file?

786


Which property needs to be set for script manager control to extend the time before throwing time out expection if no response is received from the server?

760


Hello, Using Visual Studio 2005 (VB) I am working to create a Web Site implementing the following: Within a gridView I have placed a dropdownlist control with a DataSourceID="SDSLkupList". SDSLkupList is a sqlDataSource used to store a lookup list for dropdownlist translation from ID to text. SDSLkupList contains the translation text and other fields related to the dropdown selection ID. (Thought it would be efficient to get everything at the same time.) I would like to provide the user the ability to select from the dropdownlist and, based on the selection, use labels to list related columns stored on the SDSLkupList in separate gridView columns. I have read that SqlDataSources are not meant to be used for individual controls. Since SDSLkupList contains all related information, is there a way to do a find using the dropdownlist selectedValue? (I was not able to discover one.) Otherwise, what should I use? It would need to set the labels on the gridView DataRowBound event as well as the SelectedIndexChanged events. Has anyone done this? Any help would be appreciated. Thanks in Advance. Neal

1623


Explain form level validation and field level validation?

789


What are ASHX files?

830


What is authorization in asp.net?

819


Explain the flow of processing of the request? : asp.net mvc

749