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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Virtual Include not work

Status
Not open for further replies.

Jimuniguy

Technical User
Mar 6, 2002
363
GB
Hi,

I am trying to get this virtual include to work:

Code:
<!--#include virtual=&quot;/css/stylesback1.css&quot; -->

At present, the file I am accessing is in a directory called ASP, and the CSS file is in a CSS folder, both are in the root folder, aka one click away

So why is this include not working for?

Cheers

James
 
Hi James,

The syntax for including a stylesheet is different to other documents. Use this code in the head section:

<link rel=&quot;stylesheet&quot; href=&quot;/css/stylesback1.css&quot; type=&quot;text/css&quot;>

Hope that works for u.
Nick (Web Designer)


nick@retrographics.co.uk
 
Hi Nick,

Yes I know how to normally do a CSS file (Been programming HTML for years now), but I want to do it as an include in an ASP page.

It works just fine if the file is in the same directory, as a normal #include file command, but it wont do the virtual command when the CSS is in a different folder.

Suggestions?

Cheers

James
 
Hi,

No niether work, the debugger still says &quot;unable to find file&quot; on my PWS server :-(

James
 
just looked in my ASP book/bible and it says:

&quot;Note that the included file can be in the same directory or in a subdirectory, but it cannot be in a directory above the page with the #include directive.&quot;


Tony
reddot.gif WIDTH=300 HEIGHT=2 VSPACE=3

 
Hi,

Nah I sorted out.

First of all, Howard Marks (Nick) <!--#include virtual=&quot;css/stylesback1.css&quot; --> code is right

What i hadn't realised is, is that I was including the file twice over and had not actually changed the second file.

Silly me.

All is well.

Cheers Nick for your support, I now know why i stayed away from ASP for such a long time :p

Thanks all

James
 
why cant you just:

<!-- #INCLUDE FILE=&quot;css/stylesback1.css&quot; -->

make sure you have the <STYLE> and </STYLE> tags around the include
 
See above why, my own silly mistake!

Cheers though

James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top