Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / sujata

A) yes we can do it by
1)Server.transfer(“Default2.aspx”);
2)with postbackURL property in the button event.

Source Page:

protected void Page_Load(object sender, EventArgs e)
{
if (ViewState["NameOfUser"] != null)
Label1.Text = ViewState["NameOfUser"].ToString();
else
Label1.Text = "Not set yet...";

}
protected void Button1_Click(object sender, EventArgs e)
{
ViewState["NameOfUser"] = TextBox1.Text;
Label1.Text = TextBox1.Text;
Server.Transfer("Default2.aspx"); //Response.Redirect("Default2.aspx");(Cannot do wit response.redirect")

}

Target Page:

protected void Page_Load(object sender, EventArgs e)
{
Response.Write(((Label)PreviousPage.FindControl("Label1")).Text);
Label1.Text =" " + ((Label)PreviousPage.FindControl("Label1")).Text;

}

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of execute non query in asp.net?

984


What is a page life cycle?

1051


Explain server side state management system.

964


What is break mode?

946


Explain the updatepanel?

1027


Explain the difference between debug.write and trace.write?

984


How Session use Cookies in State Management?

1073


When using the Pager object, inorder to know which page to go, which property you have to set to grid?

1038


Should I delete cookies?

971


Why is xap important?

1012


What is the difference between asp.net mvc and asp.net webforms? : asp.net mvc

1048


What are session and cookies?

988


What is difference between cache and session?

973


how to elimainte the similar data from the different tables

2178


Define page output caching?

1014