📄 listing0507.aspx
字号:
<%@ Page Language="VB" %>
<script runat="server">
sub Submit(obj as object, e as eventargs)
dim strIncome as string = lbIncome.SelectedItem.Text
dim strAge as string = rlAge.SelectedItem.Text
lblMessage.Text = "Hello " & tbName.Text & "!<p>" & _
"Your income is: " & strIncome & "<br>" & _
"Your age is: " & strAge & "<br>"
if rlAge.SelectedIndex < 3 then
lblMessage.Text += "You're a young one!<p>"
else
lblMessage.Text += "You're a wise one!<p>"
end if
if cbNewsletter.Checked then
lblMessage.Text += "You will be receiving our" & _
" newsletter shortly."
end if
end sub
</script>
<html><body>
<form runat="server">
<asp:Label id="lblHeader" runat="server"
Height="25px" Width="100%" BackColor="#ddaa66"
ForeColor="white" Font-Bold="true"
Text="A Web Controls Example" />
<br>
<asp:Label id="lblMessage" runat="server" /><p>
Enter your name:
<asp:TextBox id="tbName" runat="server" /><p>
Choose your age:<br>
<asp:RadioButtonList id="rlAge" runat="server"
RepeatDirection="horizontal">
<asp:ListItem><18</asp:ListItem>
<asp:ListItem>19-24</asp:ListItem>
<asp:ListItem>25-34</asp:ListItem>
<asp:ListItem>35-49</asp:ListItem>
<asp:ListItem>50-65</asp:ListItem>
</asp:RadioButtonList><p>
Choose your income:<br>
<asp:ListBox id="lbIncome" runat="server"
size=1>
<asp:ListItem>< $999/year</asp:ListItem>
<asp:ListItem>$1000-$9999</asp:ListItem>
<asp:ListItem>$10000-$49999</asp:ListItem>
<asp:ListItem>> $50000</asp:ListItem>
</asp:ListBox><p>
Do you want to receive our newsletter?<br>
<asp:Checkbox id="cbNewsletter" runat="server"
Text="Yes!" /><p>
<asp:Button id="btSubmit" runat="server"
Text="Submit" OnClick="Submit" />
</form>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -