-
Notifications
You must be signed in to change notification settings - Fork 0
/
sample.aspx
165 lines (141 loc) · 6.21 KB
/
sample.aspx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
<%@ Register TagPrefix="Acme" TagName="Address" Src="address.ascx" %>
<html>
<script language="C#" runat="server">
void Page_Load(Object Src, EventArgs E ) {
if (!IsPostBack)
ViewState["PanelIndex"] = 0;
}
void Next_Click(Object Src, EventArgs E ) {
String PrevPanelId = "Panel" + ViewState["PanelIndex"].ToString();
ViewState["PanelIndex"] = (int)ViewState["PanelIndex"] + 1;
String PanelId = "Panel" + ViewState["PanelIndex"].ToString();
System.Web.UI.WebControls.Panel p =
(System.Web.UI.WebControls.Panel)FindControl(PanelId);
p.Visible=true;
p = (System.Web.UI.WebControls.Panel)FindControl(PrevPanelId);
p.Visible=false;
}
void Prev_Click(Object Src, EventArgs E ) {
String PanelId = "Panel" + ViewState["PanelIndex"].ToString();
ViewState["PanelIndex"] = (int)ViewState["PanelIndex"] - 1;
String PrevPanelId = "Panel" + ViewState["PanelIndex"].ToString();
System.Web.UI.WebControls.Panel p =
(System.Web.UI.WebControls.Panel)FindControl(PanelId);
p.Visible=false;
p = (System.Web.UI.WebControls.Panel)FindControl(PrevPanelId);
p.Visible=true;
}
void Finish_Click(Object Src, EventArgs E ) {
String PanelId = "Panel" + ViewState["PanelIndex"].ToString();
System.Web.UI.WebControls.Panel p =
(System.Web.UI.WebControls.Panel)FindControl(PanelId);
p.Visible=false;
MyLabel.Text += "<b>Thank You! We received the following information: </b><p>";
MyLabel.Text += "First Name: " + FirstName.Value + "<br>";
MyLabel.Text += "Last Name: " + LastName.Value + "<br>";
MyLabel.Text += "Address: " + Address.Address + "<br>";
MyLabel.Text += "City: " + Address.City + "<br>";
MyLabel.Text += "State: " + Address.State + "<br>";
MyLabel.Text += "Zip: " + Address.Zip + "<br>";
MyLabel.Text += "Card Number: " + CardNum.Value + "<br>";
MyLabel.Text += "Card Type: " + CardType.SelectedItem.Value + "<br>";
MyLabel.Text += "Expires: " + Expires.Value + "<br>";
}
</script>
<body style="font: 10pt verdana">
<h3><font face="Verdana">Using PageState</font></h3>
<form runat="server">
<ASP:Panel id="Panel0" Visible="true" runat="server">
<table width="500" height="200" style="font:10pt verdana;background-color:cccccc;border-width:1;border-style:solid;border-color:black">
<tr>
<td style="padding:10,10,10,10" valign="top">
<table height="100%" style="font:10pt verdana;">
<tr>
<td colspan="2"><b>Complete the following fields, then choose Next to continue:</b></td>
</tr>
<tr height="20"/>
<tr>
<td>First Name:</td>
<td><input id="FirstName" type="text" size="45" runat="server"></td>
</tr>
<tr>
<td>Last Name:</td>
<td><input id="LastName" type="text" size="45" runat="server"></td>
</tr>
<tr>
<td colspan="2" align="right" height="100%" valign="bottom">
<input type="submit" Value=" Next >> " OnServerClick="Next_Click" runat="server">
</td>
</tr>
</table>
</td>
</tr>
</table>
</ASP:Panel>
<ASP:Panel id="Panel1" Visible="false" runat="server">
<table width="500" height="200" style="font:10pt verdana;background-color:cccccc;border-width:1;border-style:solid;border-color:black">
<tr>
<td style="padding:10,10,10,10" valign="top">
<table height="100%" style="font:10pt verdana;">
<tr>
<td colspan="2"><b>Complete the following fields, then choose Next to continue:</b></td>
</tr>
<tr height="20"/>
<tr>
<td colspan="2">
<Acme:Address id="Address" ShowCaption="false" runat="server"/>
</td>
</tr>
<tr>
<td colspan="2" align="right" valign="bottom" height="100%">
<input type="submit" Value=" << Back " OnServerClick="Prev_Click" runat="server">
<input type="submit" Value=" Next >> " OnServerClick="Next_Click" runat="server">
</td>
</tr>
</table>
</td>
</tr>
</table>
</ASP:Panel>
<ASP:Panel id="Panel2" Visible="false" runat="server">
<table width="500" height="200" style="font:10pt verdana;background-color:cccccc;border-width:1;border-style:solid;border-color:black">
<tr>
<td style="padding:10,10,10,10" valign="top">
<table height="100%" style="font:10pt verdana;">
<tr>
<td colspan="2"><b>Complete the following fields, then choose Next to continue:</b></td>
</tr>
<tr height="20"/>
<tr>
<td>Card Number: </td>
<td><input id="CardNum" size="45" type="text" runat="server"/></td>
</tr>
<tr>
<td>Card Type: </td>
<td>
<asp:DropDownList id="CardType" runat="server">
<asp:ListItem>Visa</asp:ListItem>
<asp:ListItem>Mastercard</asp:ListItem>
<asp:ListItem>Discover</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td>Expires: </td>
<td><input id="Expires" type="text" runat="server"/></td>
</tr>
<tr>
<td colspan="2" align="right" valign="bottom" height="100%">
<input type="submit" Value=" << Back " OnServerClick="Prev_Click" runat="server">
<input type="submit" Value=" Finish " OnServerClick="Finish_Click" runat="server">
</td>
</tr>
</table>
</td>
</tr>
</table>
</ASP:Panel>
</form>
<asp:Label id="MyLabel" EnableViewState="false" runat="server"/>
</body>
</html>