<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>
|