ASP include question

pmj7's picture

He has: 234 posts

Joined: Nov 2002

Hi

I don't think this is possible, but since I'm fairly new to ASP I thought I'd ask!

Suppose I have a file content.asp that has server-side vbscript on it. You can load this page up in your browser. Now I have another page, call it home.asp, which also has vbscript (also server-side) on it. It there any way I can include content.asp on home.asp without introducing any extra files?

Thanks!

Peter

Touchup image processing applet
Pixel Development Web Design, Photography

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

ASP uses SSI tags to include files.

pmj7's picture

He has: 234 posts

Joined: Nov 2002

The difficulty in my question is that unless the very first statement of a vbscript .asp file sets the language, you get:

"The @ command must be the first command within the Active Server Page."

If content.asp and home.asp both have @ Language=VBScript, and you get another error when including the file, @ Command can only occur once in an ASP file.

The semi-answer is that the @ Language=VBScript can apparently be removed without ill-effects on a IIs server. I guess this is because vbscript is it's default language.

Another solution is to have an additional file, contentguts.asp. content.asp would then contain the required page shell (including the language=vbscript) and simply include contentguts.asp. home.asp could then include content.asp without ill effects. The point of my question was to see if there was a good way of avoiding the additional file.

Peter

Touchup image processing applet
Pixel Development Web Design, Photography

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

Oh... I wasn't aware of that problem. I've only used ASP on IIS, and I've never put the @ Language in.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.