Is there a way to have a hash table as a select list that, when the user selects an option, it populates a paragraph for that option in a label? I have the code that displays the selected item's value, but I don't know how to add a paragraph or sentence that doesn't show up in the select list. I want a few options, and then wen they pick an option, it says something else (like something that wasn't in the list, like a paragraph or sentence about the option picked). Can anyone help with that?
I'm working with this:
<script runat="server">
sub Page_Load
if Not Page.IsPostBack then
dim mycountries=New Hashtable
mycountries.Add("G", "Grooming")
mycountries.Add("H", "Health")
mycountries.Add("F", "Feeding")
mycountries.Add("E", "Exercise")
mycountries.Add("S", "Species")
dd.DataSource=mycountries
dd.DataValueField="Key"
dd.DataTextField="Value"
dd.DataBind()
end if
end sub
sub displayMessage(s as Object,e As EventArgs)
lbl1.text="Your favorite country is: " & dd.SelectedItem.Text
end sub
</script>
<html>
<body>
<form id="Form1" runat="server">
<asp:DropDownList id="dd" runat="server"
AutoPostBack="True" onSelectedIndexChanged="displayMessage" />
<p><asp:label id="lbl1" runat="server" /></p>
</form>
</body>
</html>