<%@Page language="c#" runat="server" %>
<script runat="server">
protected void Page_Load(object o, EventArgs e) {
step1.Visible = false;
step2.Visible = false;
step3.Visible = false;
if(!IsPostBack) {
step1.Visible = true;
return;
}
}
protected void ClickStep1(object o, EventArgs e) {
step2.Visible = true;
}
protected void ClickStep2(object o, EventArgs e) {
theFinalName.Text = theName.Text;
theFinalHobby.Text = theHobby.Text;
step3.Visible = true;
}
</script>
<form runat="server">
<asp:panel id="step1" runat="server">
Name: <asp:textbox id="theName" runat="server" />
<asp:button type="submit" id="submitStep1" runat="server" Text="Go" onClick="ClickStep1"/>
</asp:panel>
<asp:panel id="step2" runat="server">
Hobby: <asp:textbox id="theHobby" runat="server"/>
<asp:button type="submit" id="submitStep2" runat="server" Text="Go" onclick="ClickStep2" />
</asp:panel>
<asp:panel id="step3" runat="server">
Done!<br />
Name: <asp:label id="theFinalName" runat="server" /><br/>
Hobby: <asp:label id="theFinalHobby" runat="server" /><br/>
</asp:panel>
</form>