ASP Include

  • Thread starter Thread starter Joseph Beard
  • Start date Start date
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
 
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.
 
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..
 
Back
Top