<%@Page language="c#" runat="server" Debug="true" %>
<script runat="server">
protected void Page_Load(object o, EventArgs e) {
if(IsPostBack) {
Session["theName"] = (string)theName.Text;
Server.Transfer("Default.aspx", false);
}
}
</script>
<form runat="server">
Name: <asp:textbox id="theName" runat="server" />
<asp:button type="submit" id="submitStep1" runat="server" Text="Go"/>
</form>
File: Default.aspx
<%@Page language="c#" runat="server" %>
<script runat="server">
protected void Page_Load(object o, EventArgs e) {
if(IsPostBack) {
Session["theHobby"] = theHobby.Text;
Server.Transfer("NextPage.aspx");
}
}
</script>
<form runat="server">
Hobby: <asp:textbox id="theHobby" runat="server"/>
<asp:button type="submit" id="submitStep2" runat="server" Text="Go"/>
</form>
File: NextPage.aspx
<%@Page language="c#" runat="server" %>
<script runat="server">
protected void Page_Load(object o, EventArgs e) {
theFinalName.Text = (string)Session["theName"];
theFinalHobby.Text = (string)Session["theHobby"];
}
</script>
<form runat="server">
Done!<br />
Name: <asp:label id="theFinalName" runat="server" /><br/>
Hobby: <asp:label id="theFinalHobby" runat="server" /><br/>
</form>
|