Cross Page Posting. - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Cross Page Posting.

macuprykmacupryk Posts: 6Member
I have the following two pages. I am wondering how can I return back.
When I click on the back link to go to page one I want the values to be saved or in the textboxes. What is the appropriate way in visual studio 2005?

CrossPage1.aspx
===============
<%@ Page Language="C#" %>



Untitled Page















Enter some Text:
Enter more Text:

Submit Page





CrossPage2.aspx
===============
<%@ Page Language="C#" %>
<%@ PreviousPageType VirtualPath="CrossPage1.aspx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">


void Page_Load(object sender, System.EventArgs e)
{
// If posted from CrossPage1.aspx to CrossPage2.aspx...

if (PreviousPage == null)
{
Response.Write("Invoke me only through cross-page posting.");
Response.End();
return;
}
else
{
// Retrieve the textbox values from FindControl
TextBox TextBox1;
TextBox TextBox2;
TextBox1 = (TextBox)PreviousPage.FindControl("TextBox1");
TextBox2 = (TextBox)PreviousPage.FindControl("TextBox2");
Response.Write(TextBox1.Text+"
"+TextBox2.Text+"
");
}


}




Page2




 



Back






Sign In or Register to comment.