Yep you are right!
It was meant to be VIRTUAL="/Kevin/.....
Somehow in ASP it probably did a fail-safe when it saw VIRTUAL="Kevin/...
and tries
http://localhost/Kevin.... address. But in ASP.NET is more
stricter and requires the VIRTUAL="/Kevin/.... where the first forward slash
/ signifies the root of the website space in
http://localhost/
I just need to do a massive search & replace in my old ASP app and hope that
still works there too!
"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:eJ**************@tk2msftngp13.phx.gbl...
re: <!-- #INCLUDE VIRTUAL="Kevin\General\ServiceClass.asp" -->
Shouldn't that be :
<!-- #INCLUDE VIRTUAL="/Kevin/General/ServiceClass.asp" -->
?
VIRTUAL means, "virtual", clearly, and does not include physical paths.
re: Could not find a part of the path
'c:\inetpub\wwwroot\Kevin\General\ServiceClass.asp x'
That makes sense.
IIS adds c:\inetpub\wwwroot because it knows that it's the root
application,
and tries to locate the virtual path you specified.
The general way of including files based on physical paths is "include
file" :
<!--#include file="ServiceClass.asp"-->
In general, though, in ASP.NET you shouldn't be using #INCLUDE to use code
in other pages.
You should use user controls ( ascx ) or class files ( *.vb or *.cs ), or
assemblies.
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Dhruba Bandopadhyay" <dh*****************@hotmail.com> wrote in message
news:uz**************@TK2MSFTNGP11.phx.gbl... In classic ASP I could write:
<!-- #INCLUDE VIRTUAL="Kevin\General\ServiceClass.asp" -->
and it would "include" that ASP file into the current ASP file. My web
application folder was not stored in C:\Inetpub\wwwroot\ but somewhere
else. But the VIRTUAL command let IIS locate files by the IIS virtual
folder.
Now in ASP.NET this does not work. It complains saying:
Could not find a part of the path
'c:\inetpub\wwwroot\Kevin\General\ServiceClass.asp x'
Is it possible creating a link/shortcut folder in \wwwroot\ ? Or how can
I get around this the easy way? I don't want to rename all VIRTUAL into
FILE and giving absolute paths.