1 Replies - 5167 Views - Last Post: 05 February 2007 - 05:51 PM Rate Topic: -----

#1 macker  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 4
  • Joined: 02-February 07

Drop-down list Problems

Posted 02 February 2007 - 01:16 PM

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

Is This A Good Question/Topic? 0
  • +

Replies To: Drop-down list Problems

#2 roadfury  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 7
  • View blog
  • Posts: 52
  • Joined: 05-February 07

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


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1