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 difference between sealed vs static class?

1174


explain code with datachaching with example

2213


How many types of session in ASP.NET

1127


How to find out what version of asp.net I am using on my machine?

1137


What are the built-in objects in asp.net?

1039


How do I force the dispose method to be called automatically, as clients can forget to call dispose method?

995


while developing webservices if i want some users to use my webservice only how can i give security to my webservice?

1905


What do you mean by query string?

985


Difference between DataGid and Girdview? Difference b/w .Net 2.0, 3.0 and 3.5 ? Diff b/w dispose & Finialize Methods?

2510


Which is better session or viewstate?

988


What is the difference between localization and globalization?

1096


Explain the difference between globalization and localization techniques

1045


How do I debug an asp.net application that was not written with visual studio.net and that does not use code-behind?

1058


What is content place holder?

1031


Explain how can we inherit a static member?

1035