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

Calling Another Page

Written by Eric Smith, Northstar Computer Systems LLC

A number of readers have asked if it is possible to "call" another ASP page in the way you might call a subroutine in another language. Currently, the only options you have available are to use Response.Redirect to transfer control to the page, or to include the code you want to call as part of the same ASP page and put it in a subroutine or function.

However, IIS 5.0 (ships with Windows 2000) has several new methods that allow you to execute another ASP page and return control to the original page when the code is complete. The Execute method of the Server object will run the code in another ASP page. Besides breaking up your code, this method can also be used to do conditional includes of other files, which the standard server-side include directives can't. The Server object also has a new Transfer method, which passes the contents of all server-level objects, such as the Response object, to the next page. This method will make it much easier to have pages working together and will save you some time in having to code all the data values into the URL, a Session variable, or some other mechanism.

Keywords: [ ASP Architecture ]

Publication Date: 10/1/1999, Last Update: 3/24/2010