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

Why is this service branded with windows livetm?

1026


How do I open an ashx file in windows 7?

1008


Which is faster union or union all?

937


What is the procedure to handle the process request using mhpm events fired? : asp.net mvc

999


Differentiate the session object and application object?

892


How many types of session in ASP.NET

1039


Can you explain one critical mapping? Performance issue which one is better? Whether connected lookup tranformation or unconnected one?

1215


What is a viewstate?

932


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

951


What is voluum?

920


Can you change a Master Page dynamically at runtime?

925


What is server side in asp.net?

933


Explain the concept of event bubbling in ASP.NET?

1026


How to reduce the width of textbox in editcommandcolumn of datagrid?

942


List the advantages and disadvantages of user control an custom control?

915