NCS Logo - Click for home page Northstar Developer Center
Platforms
All Platforms
.NET Framework (1.x - 4.x)
Active Server Pages
ASP.NET
C#
SQL Server
VB.NET
Visual Basic

Keywords
.NET Data Types
.NET E-mail
.NET Events
.NET Functions
.NET Object Programming
.NET System.Configuration
.NET System.Diagnostics
.NET System.IO
.NET System.Net
.NET System.Net.Sockets
Active Data Objects
ASP Architecture
ASP Black Belt
ASP Built-in Functions
ASP Built-in Objects
ASP Debugging
ASP Performance
ASP Security
ASP Syntax
ASP.NET Authentication
ASP.NET Controls
ASP.NET Data Access
ASP.NET Features
ASP.NET Master Pages
ASP.NET Page Events
ASP.NET Security
ASP.NET ViewState
Atom
Certifications
COM, DCOM, COM+
Data Access
E-Mail
Errors
Exporting Data
HTML Tips
IIS
Object-Oriented Programming
RSS
SQL
Uncategorized ASP Tips
VB API Programming
VB Forms
VB Syntax
XML

Book Support
Visual Basic 6 Bible
ASP Bible
ASP Weekend Crash Course
ASP.NET At Work
Creating Web Services

Building a Document Picker

Written by Eric Smith, Northstar Computer Systems LLC

If you have limited space on your page, drop-down lists are an easy way to minimize space consumption for long lists of links or documents. Let's say, for instance, you have a list of links that can be selected by the user. Here's the HTML you can put in the selection page:
<html>
<head>
   <title>Link Test</title>
</head>
<body bgcolor=#FFFFFF>
<form action="test_response.asp" method="post">   
   Select link: 
   <select name="cboLinks">
      <option value="http://www.microsoft.com">Microsoft</option>
      <option value="http://www.google.com">Google</option>
      <option value="http://www.yahoo.com">Yahoo!</option>
   </select>
   <input type="submit" value="Go!" name="cmdSubmit">
</form>
</body>
</html>
The code that goes in the response page, test_response.asp, is just this:
<%
   Response.Redirect Request("cboLinks")
%>
This code takes the value of the drop-down list and redirects the browser to that link. You should probably add some error checking to make sure that the cboLinks value was actually selected before redirecting to it. You can also adapt this for any type of link or document, including Word, Excel, or even Adobe PDF files. The browser will figure out what to do with the document.

Keywords: [ ASP Black Belt ]

Publication Date: 9/1/1999, Last Update: 2/13/2010