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

Linking to External Sites

Written by Eric Smith, Northstar Computer Systems LLC

One of the hardest things for web site owners to do is to put up links to other sites. It's not that creating the links is hard; rather, putting up external links is inviting people to leave your site. Most people, once they leave a site, don't come back. To give people the option to return to both of my sites, I created a page wrapper that lets the user browse the external site but allows them to click a link in a top frame to return to my site. Here's the code for the browsing page, external.asp:
<html>
<head>
<title>ASP Techniques: Browsing to External Site</title>
</head>
<frameset  rows="60,*">
    <frame name="fraTop" src="/external_top.asp" marginwidth="10" marginheight="10" scrolling="no" frameborder="no" noresize>
    <frame name="fraContent" src="<% = Request("url") %>" marginwidth="10" marginheight="10" scrolling="auto" frameborder="no">
</frameset>
</html>
The second part of the page is external_top.asp, shown here:
<html>
<head>
<title>ASP Techniques: Browsing to External Site</title>
</head>
<body bgcolor=#990000>
<table cellpadding=5 cellspacing=0>
<tr>
<td valign=middle>
<a href="/" target=_top><img src="/pics/logo.gif" width=168 height=38 alt="ASP Techniques - Return to Home Page" border=0 valign=middle></a>
</td>
<td valign=middle>
<font color=#FFFFFF Face="Tahoma, Arial Black, Arial, Helvetica" Size=4><b>Remember to come back when you're done surfing!</b></font>
</td>
</tr>
</table>
</body>
</html>
Here's how an external link on my site would show up:
<a href="external.asp?url=http://www.tipworld.com">

Keywords: [ Uncategorized ASP Tips ]

Publication Date: 1/1/2000