Including Files In Asp - Using

free web hosting
Open Discussion > CONTRIBUTE > Computers > Programming Languages > .NET ( ASP.net VB.net )

Including Files In Asp - Using

sachavdk
I'm making a page (in ASP2.0 with VBScript) wich has to include a file but the path to it is composed.

Normally inluding a file is done using
<!--#INCLUDE FILE="file.asp"-->

But the url to the file is now composed as I said trough some variables:
Server.MapPath(conPath & Request.QueryString("p") & "/index.asp")

This whole bunch (in an example case the variable should be "./Conten/Main/Home/index.asp" which shoul be included.
But how do I include such a variable since next two tries of me didn't work:

<!--#INCLUDE FILE=<%=Server.MapPath(conPath & Request.QueryString("p") & "/index.asp")%>-->

Neither worked:

<% <!--#INCLUDE FILE=Server.MapPath(conPath & Request.QueryString("p") & "/index.asp")--> %>

Reply

magiccode9
hi, sachavdk

as microsoft document said, <!-- #include --> statement should outside of asp code tag as stated in style 1 of you previous post.

actually, <!-- include --> statement have two styles:
1.) file="path / relative path to file include"
2.) virtual = "full path using web style"

however, both style are not accept using variables, you must explicit say which and where the include file you want.

if you really want it, you may try this:
vbscript ==> execute or executeglobal
jscript ==> eval

- hope this help
- Eric

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.

Recent Queries:-
  1. asp2.0 express setup - 0.94 hr back. (1)
  2. how to give ratings to audio album in asp2.0 - 128.85 hr back. (2)
  3. include file server.mappath - 200.58 hr back. (1)
  4. asp include file server.mappath - 965.01 hr back. (1)
  5. <--#include file= variable asp - 1080.51 hr back. (1)
Similar Topics

Keywords : including files asp


    Looking for including, files, asp

*RANDOM STUFF*





*SIMILAR VIDEOS*
Searching Video's for including, files, asp

*MORE FROM TRAP17.COM*
advertisement



Including Files In Asp - Using



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute your information that might help someone here.
Ask your Doubts & Queries to get answers.. "Together, We enlight each other!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE