Connecting Tech Pros Worldwide Forums | Help | Site Map

How to view values selected from a dropdownlist

Newbie
 
Join Date: Oct 2009
Posts: 1
#1: Oct 22 '09
Heres what i did:
Expand|Select|Wrap|Line Numbers
  1.  Protected Sub DropDownList2_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList2.SelectedIndexChanged
  2.  
  3.        if DropDownList1.SelectedValue = "Author" then
  4.           MsgBox("a")
  5.         ElseIf DropDownList1.SelectedValue = "ISBN" Then
  6.           MsgBox("i")
  7.         Else
  8.          MsgBox("Select something")
  9.         End If

CroCrew's Avatar
Expert
 
Join Date: Jan 2008
Location: Michigan
Posts: 338
#2: Oct 22 '09

re: How to view values selected from a dropdownlist


This is a asp.net question not a Classic ASP question.

All the best,
CroCrew~
jhardman's Avatar
Moderator
 
Join Date: Jan 2007
Location: logan, utah
Posts: 2,690
#3: Oct 23 '09

re: How to view values selected from a dropdownlist


I moved it to the right place for you. Hope you find a good answer here.

Jared
Frinavale's Avatar
Site Moderator
 
Join Date: Oct 2006
Location: The Great White North
Posts: 5,137
#4: 4 Weeks Ago

re: How to view values selected from a dropdownlist


You haven't really stated what the problem is.

Maybe it's the fact that you are trying to use a Message Box to display the selected value. There is no such feature in ASP.NET (MsgBox is only available in windows desktop applications).

Try placing a Label on the page and set the Text property of the label to show the selected value instead.

-Frinny
Reply