ASP Include

J

Joseph Beard

At one time, I developed using ASP and VBScript, and I could use an
include directive to include the contents of one file in the server
response to the client. I have found that I can do this with asp.net as
well, except that whenever I do, I get the error message "There can only
be one 'page' directive." I can work around that by simply removing the
page directive from the file being included, but I was hoping to be able
to use two aspx files, complete with all their code-workings and
everything. Any suggestions? Is there a new, ASP.NET tid bit of code
that I can use to do this? I'm using ASP.NET 2003 with Visual Basic
pages, by the way.

Thanks.

Joseph Beard
 
K

Kevin Spencer

Don't use ASP-style includes. Instead, create User Controls, and add them to
your page.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
The more I learn, the less I know.
 
F

Frank Drebin

The concept of "User Controls" have replaced include files.. So let's say
you wanted to always include a "For Internal Use Only" at the bottom of
every page, right? Well, make a user control called "Disclaimer.ascx" - and
put that at the bottom of every page..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,241
Latest member
Lisa1997

Latest Threads

Top