Http://www.cnblogs.com/ghd258/archive/2005/10/26/262511.html
In ASP. NET 2.0, a reasonable solution has been provided for cross-Page Submission.
The following is an example:
Beginpage. aspx: Pay attention to the postbackurl attribute setting of button1
<% @ Page Language = "C #" %>
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<SCRIPT runat = "server">
Public string name
{
Get
{
Return this. textbox1.text;
}
}
</SCRIPT>
<HTML xmlns = "http://www.w3.org/1999/xhtml">
<Head runat = "server">
<Title> untitled page </title>
</Head>
<Body>
<Form ID = "form1" runat = "server">
<Div>
<Asp: Label id = "label1" runat = "server" text = "Enter the name" width = "183px"> </ASP: Label>
<Asp: textbox id = "textbox1" runat = "server"> </ASP: textbox>
<Asp: button id = "button1" runat = "server" text = "Submit" postbackurl = "~ /Endpage. aspx "/> </div>
</Form>
</Body>
</Html>
Endpage. aspx: note the attribute settings of previouspagetype.
<% @ Page Language = "C #" %>
<% @ Previouspagetype virtualpath = "~ /Sourcepage. aspx "%>
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<SCRIPT runat = "server">
Protected void page_load (Object sender, eventargs E)
{
This. label1.text = previouspage. Name;
}
</SCRIPT>
<HTML xmlns = "http://www.w3.org/1999/xhtml">
<Head runat = "server">
<Title> untitled page </title>
</Head>
<Body>
<Form ID = "form1" runat = "server">
<Div>
<Asp: Label id = "label1" runat = "server"> </ASP: Label>
</Div>
</Form>
</Body>
</Html>
OK. With these two simple attribute settings, you can easily obtain cross-page submission features.