⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 switchcase.aspx

📁 asp.net1.1入门经典C#.2003
💻 ASPX
字号:
<script language="C#" 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"/>
</form>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -