I have populated a drop down list on my ASP.NET page....Default.aspx......with a list of links...that is the problem...
I want to use the selected item, and use it as a link.
I am trying to do this by using a select case within the selectedindexchanged event. This is all the code I have so far. I have links on the page, but I want to use this drop-down as the links.
Any help would be wonderful!!
Thank you
**********************************************************************
Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
Select Case DropDownList1.SelectedIndex
Case Is = 1
'This is where I want to put the link, if this option is selected,
'then go to this link.......I know this is selected index 1, not 0
'I have a placeholder for selected index 0
Case Is = 2
'this is where the command to the link,,,,,open this asp page
Case Is = 3
'this is the other link
End Select
End Sub
Drop-down list Problems
Page 1 of 11 Replies - 4773 Views - Last Post: 05 February 2007 - 05:51 PM
Replies To: Drop-down list Problems
#2
Re: Drop-down list Problems
Posted 05 February 2007 - 05:51 PM
If you're asking what the code is to transfer your users to another web page, try this:
Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
Select Case sender.SelectedIndex
Case 1
'Send them somewhere
Server.Transfer("http://www.somesite.com/page.aspx")
Case 2
'Send them somewhere else
Server.Transfer("http://www.someothersite.com/page.aspx")
End Select
End Sub
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote





|