.net中swith,case开关语句的使用
来源:互联网 发布:淘宝客小程序源码 编辑:程序博客网 时间:2024/05/10 09:18
<%@ Page Language="c#" %>
<script runat="server">
void Page_Load()
{
if (Page.IsPostBack) {
switch(Destination.SelectedItem.Value)
{
case "Barcelona":
Message.Text = "You selected Spain's lively Catalan city";
break;
case "Oslo":
Message.Text = "Experience the majesty of Norway's capital city";
break;
case "Lisbon":
Message.Text = "Portugal's famous seaport and cultural hub";
break;
default:
Message.Text = "you did not select a destination we travel to";
break;
}
}
}
</script>
<html>
<head>
</head>
<body>
<form runat="server">
Select your choice of destination:
<br />
<br />
<asp:radiobuttonlist id="Destination" runat="server">
<asp:listitem>Barcelona</asp:listitem>
<asp:listitem>Oslo</asp:listitem>
<asp:listitem>Lisbon</asp:listitem>
</asp:radiobuttonlist>
<br />
<br />
<input type="submit" value="Submit Choice" />
<br />
<br />
<asp:Label id="Message" runat="server"></asp:Label>
</form>
</body>
</html>
<script runat="server">
void Page_Load()
{
if (Page.IsPostBack) {
switch(Destination.SelectedItem.Value)
{
case "Barcelona":
Message.Text = "You selected Spain's lively Catalan city";
break;
case "Oslo":
Message.Text = "Experience the majesty of Norway's capital city";
break;
case "Lisbon":
Message.Text = "Portugal's famous seaport and cultural hub";
break;
default:
Message.Text = "you did not select a destination we travel to";
break;
}
}
}
</script>
<html>
<head>
</head>
<body>
<form runat="server">
Select your choice of destination:
<br />
<br />
<asp:radiobuttonlist id="Destination" runat="server">
<asp:listitem>Barcelona</asp:listitem>
<asp:listitem>Oslo</asp:listitem>
<asp:listitem>Lisbon</asp:listitem>
</asp:radiobuttonlist>
<br />
<br />
<input type="submit" value="Submit Choice" />
<br />
<br />
<asp:Label id="Message" runat="server"></asp:Label>
</form>
</body>
</html>
- .net中swith,case开关语句的使用
- 类似java中swith case语句的sql语句
- PHP流程控制语句-swith...case语句
- JAVA Swith语句使用
- swith case
- Oracle中case语句的使用实例
- PL/SQL 中 CASE 语句的使用
- mysql中case语句的使用
- PL/SQL 中 CASE 语句的使用
- SQL语句中case when的使用
- C#基础-007 swith-case的用法
- case语句的使用
- swith语句
- Mysql中使用case语句
- Sql 语句中case使用
- 使用Swith遇到的问题
- swith case执行顺序
- switch case语句的使用
- 互动平台开发笔记 2005-3-15
- 清晰性和可测试性的权衡
- .net中for循环的使用
- VC中实现多格式图像的灵活转换
- Struts学习 错误:exception: cannot find actionmappings or actionformbeans collection
- .net中swith,case开关语句的使用
- 早上的时候发现生活的残酷!
- WINDOW自带工具.
- .net中使用while语句的使用
- MapXtreme2004代码 几个地图工具的使用(C#)
- eclipse 下配置jboss3.22
- 创建可分页、可排序的 DataGrid
- SQL注入
- Ring的权限提升21大法!