<%@ Page Language=VB Debug=true %>
<script runat=server>
Sub PanelNameEmail_Click(Sender As Object, E As EventArgs)
PanelNameEmail.Visible = False
PanelPhoneNumbers.Visible = True
End Sub
Sub PanelPhoneNumbers_Click(Sender As Object, E As EventArgs)
lblSummary.Text = "Name: " & txtName.Text & "<BR>" _
& "Email: " & txtEmail.Text & "<BR>" _
& "Phone Number: " & txtPhoneNumber.Text & "<BR>" _
& "Fax Number: " & txtFaxNumber.Text & "<BR>"
PanelPhoneNumbers.Visible = False
PanelSummary.Visible = True
End Sub
Sub PanelSummary_Click(Sender As Object, E As EventArgs)
PanelSummary.Visible = False
PanelNameEmail.Visible = True
End Sub
</SCRIPT>
<HTML>
<HEAD>
<TITLE>Using Panel Controls to Control Code Flow</TITLE>
</HEAD>
<BODY LEFTMARGIN="40">
<form runat="server">
<asp:panel
id="PanelNameEmail"
runat="server"
visible="True"
>
Enter your name:<BR>
<asp:textbox
id="txtName"
runat=server
/>
<BR>
Enter your email address:<BR>
<asp:textbox
id="txtEmail"
runat=server
/>
<BR>
<asp:button
id="butNameEmail"
text="OK"
onclick="PanelNameEmail_Click"
runat="server"
/>
</asp:Panel>
<asp:panel
id="PanelPhoneNumbers"
runat="server"
visible="False"
>
Enter your Phone Number:<BR>
<asp:textbox
id="txtPhoneNumber"
runat=server
/>
<BR>
Enter your Fax Number:<BR>
<asp:textbox
id="txtFaxNumber"
runat=server
/>
<BR>
<asp:button
id="butPhoneNumbers"
text="OK"
onclick="PanelPhoneNumbers_Click"
runat="server"
/>
</asp:Panel>
<asp:panel
id="PanelSummary"
runat="server"
visible="False"
>
<asp:label
id="lblSummary"
runat=server
/>
<BR>
<asp:button
id="butSummary"
text="Change Values"
onclick="PanelSummary_Click"
runat="server"
/>
</asp:Panel>
</form>
</BODY>
</HTML>
|