Many times we need to perform an action or display
something different based on some different parameters. Using select case is one
such way to do this. Below is an example of how this can be done.
Lets say you have a three different choices in a dropdown
box named choices. For example a user will choose either 1, 2 or 3. Now
based on the selection they make you want to show three different tings. An easy
way to do this is in the code below:
<%
Dim whichOne
'here we are getting the number from the dropdown
whichOne = Request.Form("choices")
'now we will use this to make our desicion
Select Case whichOne
Case 1
'if whichOne is one we do this
Response.Write "You selected one"
Case 2
'if whichOne is two we do this
Response.Write "You selected two"
Case 3
'if whichOne is three we do this
Response.Write "You selected three"
Case Else
'otherwise we tell them they did not make a choice
Response.Write "You did not make a choice, go back and do so now."
End Select