Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > VB.NET 2002/2003 Basics
|
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 19th, 2004, 12:20 PM
Registered User
 
Join Date: Aug 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Need help with dropdownlist jumping

I am just starting out with asp.net and was wondering if I was heading in the right direction. Do I need to use eventhandlers to make a dropdownlist jump to another page that I have? Because all the pages are different for each item in the list.
 
Old September 12th, 2004, 09:48 PM
Registered User
 
Join Date: Sep 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You could do it the way you suggested, it would work, however it would require the user to first post back to the page, then to the new page.

    Private Sub DropDownList1(. . .) Handles DropDownList1.SelectionChanged

        Select Case DropDownList1.SelectedIndex
            Case 0
                Response.Redirect("PageOne.aspx")
            Case 1
                Response.Redirect("PageTwo.aspx")
                .
                .
                .
        End Select

    End Sub

There is another way to do it by adding an "OnChange" parameter to the HTML <asp:DropDownList> tag and setting AutoPostBack to false.

I haven't tested it but something like:

<asp:DropDownList id="ddl1" runat=Server OnChange="javascript:location.href='/pages/' + ddl1.value + '.aspx';">
. . .
</asp:DropDownList>






Similar Threads
Thread Thread Starter Forum Replies Last Post
Jumping from ASP to ASP.net -- VB? jn148 ASP.NET 3.5 Basics 9 August 25th, 2008 02:25 PM
Jumping into java extensions to Saxon mphare XSLT 2 April 29th, 2008 10:02 PM
Jumping to specific record in FormView based on ID peter0480 ASP.NET 2.0 Basics 5 June 18th, 2007 04:37 AM
how to prevent page jumping while click on iframe' kathirnk HTML Code Clinic 0 April 16th, 2007 06:39 AM
Avoid 'jumping' in continous forms ocliff Access 4 March 7th, 2006 05:15 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.