Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 5th, 2008, 04:05 PM
Friend of Wrox
Points: 2,101, Level: 18
Points: 2,101, Level: 18 Points: 2,101, Level: 18 Points: 2,101, Level: 18
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2003
Location: , , .
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default Include file trouble

Hi All,

Thanks for your response.

I'm having trouble with a file include. I have an application that is running fine but when I moved it to my laptop I can't get the file include to work. I keep getting a "The Page Cannot Be Found" error. I've tried every possible combination I can think of and still I can't get it to work. I've been working with include files for years but this one's got me stumped.



One difference between what is on the server (w3k) and my laptop is that on the server it has its own web site and IP address and everything is in the root of that application. On my laptop I'm running XP so I created a virtual folder to run the app locally.

Microsoft suggests looking up the exact path of the file in IIS and using that path. The paths for the file when looking in IIS on the XP box:

Virtual Path: /extranet/include/menu.asp
File Location: C:\Websites\avantienv_com\include\web.config (menu.asp)
Local Path: \extranet\include\menu.asp

I tried all of these and more. Nothing worked.

Thank you,
Richard



 
Old February 9th, 2008, 08:06 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Richard,

When creating a virtual directory, things move from location. What used to be the root of the server is now something like /VDName. So, /Includes may no longer point to a folder in the root of your server and you may now need to use something like /VDName/Includes.

That said, includes are considered "old skool" now. There are much better alternatives available (User Control, Master Pages, base pages and so on) so in most applications you really shouldn't have the need for includes anymore.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old February 11th, 2008, 05:12 PM
Friend of Wrox
Points: 2,101, Level: 18
Points: 2,101, Level: 18 Points: 2,101, Level: 18 Points: 2,101, Level: 18
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2003
Location: , , .
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

Hi Imar,

Thanks for getting back to me. It was a dumb mistake. IIS was pointing to C:\inetpub\wwwroot. I originally had a virtual folder pointing to the app but I eliminated the virtual folder and pointed IIS at the root of the app and all is well. I use <%@ Register TagPrefix="include" TagName="Menu" src="include/menu.ascx" %> for my aspx pages and that works great. This application still has some classic asp pages in it that's why I'm still using #include on those pages.

Thanks for the reply. Very much appreciated.

Richard

 
Old February 12th, 2008, 01:21 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You're welcome. Glad it's working now.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.




Similar Threads
Thread Thread Starter Forum Replies Last Post
Include file morpheus BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 1 April 23rd, 2006 08:20 AM
difference between include file & include virtual crmpicco Classic ASP Basics 2 January 23rd, 2006 11:50 AM
Include File morpheus Beginning PHP 8 January 17th, 2006 09:30 AM
Connection string and file include trouble cramerjj Classic ASP Databases 2 February 26th, 2005 04:46 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.