Welcome to Dream.In.Code
Become an Expert!

Join 149,825 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,581 people online right now. Registration is fast and FREE... Join Now!




Drop-down list Problems

 
Reply to this topicStart new topic

Drop-down list Problems

macker
2 Feb, 2007 - 12:16 PM
Post #1

New D.I.C Head
*

Joined: 2 Feb, 2007
Posts: 4



Thanked: 1 times
My Contributions
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
User is offlineProfile CardPM
+Quote Post

roadfury
RE: Drop-down List Problems
5 Feb, 2007 - 04:51 PM
Post #2

New D.I.C Head
Group Icon

Joined: 5 Feb, 2007
Posts: 11


My Contributions
If you're asking what the code is to transfer your users to another web page, try this:

CODE

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


User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 09:25AM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month