Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to include other pages?

Status
Not open for further replies.

NaiDanac

Programmer
Mar 25, 2004
96
US
I have an application with a navigation bar on the left hand side. The navigation bar is part of every page of the application, and I include it using:

Code:
<!--#include virtual="/abc/abc.aspx"-->

Initially, the abc.aspx file was nothing more than straight html, with no code behind:

Code:
<html>
<head><title>ABC</title</head>
<body>....</body>
</html>

I would like the abc.aspx page to contain controls that read data from the database. I tried adding the page directive to associate it with a abc.aspx.vb file, but couldn't.

Code:
<%@ Page CodeBehind="abc.aspx.vb" Language="vb" AutoEventWireup="false" Inherits="ABC.abc" %>

I get the error indicating that there can only be one @ page directive per page!

Any ideas on how I can associate codebehind with the abc.aspx file without the page directive?

Thanks
 
RiverGuy,
What do you mean? How can I do that?

Thanks
 
If you make a user control, and put your nav bar on it, then you will be able to just drag it from your toolbox and put it on your pages.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top