Include A Variable

I'm trying to include a variable in the <!--#include file='db.asp'--> stament?

View Replies


ADVERTISEMENT

Variable Asp Include

is there a way of having a file that's name is a variable (eg dependant on the user name) act like a include. i know that you cant define the file for an include asp tag using a variable and that reading the file using "Response.Write FSO.OpenTextFile(ppp, 1, False, False).readall" prints the file, and treating it like a html file.

View Replies View Related

Variable In Include File

It is possible to add variable into the include file.

<!--#include file="../info/<%=strfoldername%>/notetosomeone.asp"-->

strfoldername is from my database. It doesn't work. Anyone knows how to solve this problem. Or has other way to do it.

View Replies View Related

#INCLUDE FILE= Variable

is it in any way possible to include a file specified by a variable name?

View Replies View Related

Passing A Variable To Use An Include

I am trying to write a little script using includes ... but I am getting errors, I am passing a URL variable to use an include.

<!--#INCLUDE VIRTUAL=Request.QueryString("path")-->

Am I missing something?

View Replies View Related

Set Variable To Include Page

im trying to make a string and in that string have an include in to include a .asp page is this possible. Code:

myhtml = ""
myhtml = myhtml & "This Should Work "
myhtml = myhtml & " <!--#include file ="TESTR.asp"--> "

View Replies View Related

Pass Variable Into Include

Is it possible to pass a variable into an include statement?

I have a link as follows:
http://mywebsite/page.asp?project=tsc

My page.asp has three include statements.

<!--#include virtual="/nav_table.asp"-->
<!--#include virtual="/directory/project.asp"-->
<!--#include virtual="/menu.asp"-->

I'm hoping to replace "directory" with the variable in the link so that I get:

<!--#include virtual="/tsc/project.asp"-->

How does one get the variable in to the line above?

View Replies View Related

Feed Variable Into Include Statement

i'm trying to change the following include statement :

<div id="contents">
<!-- #include file="includes/main_page.asp" -->
</div>

on an ASP page into something that receives the file name as a variable :

<div id="contents">
<!-- #include file="<%=fileToInclude%>" -->
</div>

however, this doesn't seem to work, as i get the following error message :

The include file '<%=fileToInclude%>' was not found.

it obviously is trying to find a file named <%=fileToInclude%> instead of seeing the variable my question is : is it possible to feed a variable into an include statement ?
if yes, how should i go about it ? if not, are there any alternatives ?

View Replies View Related

Insert A Variable Value In An INCLUDE Fiel

Any ideas how to make the 'htm1.asp' a variable name?

Say at one time we want to use 'htm1.asp' and another
time we want to use 'htm2.asp' as the include file.

Any ideas?

View Replies View Related

Inserting A Querystring Variable Into <!--include-->

activelang=Request.QueryString("lang")
.
some code
.
Response.Write " <!--#include virtual='/SIFS/" & activelang & "/welcome.txt' -->"

activelang=Request.QueryString("lang")
.
some code
.
<!--#include virtual='/SIFS/<%= activelang %>/welcome.txt' -->

Is there any trick will do the job ?

View Replies View Related

How To Print Variable In A Include Virtual?

how to assign a variable in a page then in a file that is included write a variable to an include virtual statement that's located in the 2nd included file? I've tried this but it doesn't work Code:

View Replies View Related

Accessing/Passing An Object Variable To A Server.Execute Include

I've been browsing this and a few other related newsgroups trying to get my head around this problem, and so far all the trails seem to go cold, without an acceptable solution being reached. I'm posting here because there seems to be a few MVP's knocking around, and if they dont know, then it's a safe bet nobody does.

I'm beginning to think that what I want to do is simply not possible - but i'll put it out there once more.

Here goes: I'm writing a content managaement system - and i'm making use of dynamic includes via the "read a text file" technique, and then substitiuting values into markers in the template. Code:

View Replies View Related

How To Include The Variable In The "select" Line..

first I typed this:

p=Request.QueryString("num")

then I typed this:

sqlstring = "select column1 from table where column2 like '%p%'"

it find nothing. anyway, if I replace the "p" in the second line to what it was equal, it does find what I need.

moreover, when I print "p" I get the right string.

View Replies View Related

Include More Than 1 Include File

I want to be to call my menu from another file onto my page so that i dont have to add it to every page of my website. The problem is when i try to add it using the include method it says that only one include file is allowed on an ASP. The other include file is my connection string so i cant really take that out of the page because then nothing else will work!

How can i get the menu page included as well as the connecting string?

Have added the code below, i have highlighted the 2 include files that i want to use in blue, i have also left the div tag in for where i currently have the menu which is what i want to take out and have ther include file there instead, if that makes sense. Basically the bit in red i want to be able to remove from all of my pages and add the blue file above the red code in instead, but i dont know how!!!!! Code:

View Replies View Related

Calling Com + Object Variable Or With Block Variable Not Set

I'm turning my application into a "DLL". Everything worked fine untill I try to do a "While" in my asp code. Then I recieve an error like this:

"Object variable or With block variable not set"

My vb code look like this.....

View Replies View Related

Passing Data From Javascript Variable To Asp Variable.

is there any way of passing a javascript variable over to a asp variable so
i can write it to my database.

View Replies View Related

Convert ASP Variable To Javascript Variable

How do I convert an ASP variable to a Javascript variable?

View Replies View Related

How Do I Put A Variable And A Non Variable In A From Statement?

sql = "SELECT * FROM & console &'news'"

I got that right now but i want the variable, console to be placed along with news so when it selects from the db it selects from gcnnews or whatever variable it's on. How do I do that?

View Replies View Related

Variable-variable=junk

im trying to subtart one quantity from another then stick the answer in to an update statment, but all i get is an error in syntax message

variable math bit=
qty=request.form("oqty")-Request.form("qty")

sql =
sSQL="Update spares SET spares.location='"&request("location")&_
"',spares.machine='"&request("machine")&_
"',spares.part_desc='"&request("part_desc")&_
"',spares.part_number='"&request("part_number")&_
"',spares.qty='(" & qty & ") "&_
"',spares.min_qty='"&request("min_qty")&_
"',spares.updated_by='"&session("name")&"' WHERE(spares.id)=" & form_id

View Replies View Related

Variable Name, Dependant On The Value Of Another Variable...

I need to assign a value to a variable, but this variable name is dependant upon another variable!! I am including the code below so you can see it, cos if not I am sure you are thinking whattt?? Code:

View Replies View Related

How To Include

How i can do <!--#include file="filename"--> dynamic with ASP, or any other way

View Replies View Related

#include

If I want to include a file to my webpage that is not placed in the same
folder asd the application, but in another folder on the same disk...

I found out that this is not going to work:
<!--#include virtual="D:/binaer.no/nova/test.asp"-->

Is there any other way to include from another domain account on the same
server?

There is going to be several applications that includes the same file, so
the trix ../../../ will not do it for me...

View Replies View Related

The Include

<%
I am trying to use "set con" in the include file. i used it before with simple text but when I use the connection object it doesn t work. is this possible in asp and what is the problem with the code below:

inc.asp file
VARMSG = "set con = Server.CreateObject("ADODB.connection")"
con.Open ("dsn=project;uid=sa;pwd=sa")
%>

mainpage.asp
<!-- #include file="inc.asp" -->
<%
Response.write
set rsTypes = con.execute("select * from firstmarch order by cat")
%>

View Replies View Related

Include Gif

Can someone advise how can I send an html message that include gif file using cdonts.
the gif cannot link to www, or any specific server location. user must be able to view when they open their email.no as attachment.

View Replies View Related

Asp Include?

I have asp page file0.asp which calls another asp page thru include. I have to set conditions tht....

originally the include should have file1.asp In the displayed file file1.asp user selects a hyperlink, it should take it as request and display the new file2.asp in same file0.asp in place of file1.asp.

so i want to display multiple pages on user request inside file0.asp. But originally when file0.asp loads it should have file1.asp. Code:

View Replies View Related

Include In ASP

how to include an asp file into an other asp file with checking condition first.I can do this easily in PHP, but in ASP, it seem that the content of included file is process before it read the code on page.So when I include a asp page into another asp page, I cannot choose which page will be include base on the condition.

View Replies View Related

If X Then Include Y

make a script for my forums (the header) involving the date and an included page. Quote:

If the month is 9 (September) then include page x
elseif the month is 10 (October) then include page y
else include page z

How do I go about doing that? I know how to do it in php, but I'm looking to do it with asp.

View Replies View Related

Include

I m trying to test an include example using the code below, but the page "aspsrc.asp" cannot be displayed.

--->aspsrc.inc page
<%
var msg = "testing testing"
%>


-->inc.asp page
<!-- include statement not to be placed within ASP delimiters -->
<!-- #include file=".aspsrc.inc" -->

<%
Response.Write( msg );
%>

View Replies View Related

#include

When I first started using Server Side Includes I used the regular file include:

Code:
<!--#include file = "myfile.asp"-->
Then I read where the virtual include is much beter. I figured I would try it out, so on my last project I used all virtual includes:

Code:
<!--#include virtual = "/somedirectory/somefile.asp"-->
It worked fine and I really couldn't tell any differnce. Maybe a little easier to remember where all the file needed to point to. But this was for a New Site so testing it on the server was easy. I didn't have to worry about existing content up there.

I'm now redesigning a site to add in some dynamic stuff and I always test everything on the server it will reside on to be sure everything will work. Typically I create a "v2" directory and run everything from there. Well this really screws me up when using a virtual include, becuase I would have to edit and then rededit all my file paths.

So my question is... What do you use? And why are file includes so bad?

View Replies View Related

Include Within Include

i'm calling an include file from within a <td> tag of an existing include file (i'm calling the adroator component from the head.asp file.

i'm getting the following error

Error Type:
MSWC.Adrotator (0x80004005)
ERROR Cannot load rotation schedule file
/root/includes/adrotator/adrotatorhomepage.asp, line 14

the include file head.asp is located in the includes directory while the ssi its calling is on the adrotator directory. here is the code for the adrotatorhomepage.asp (all relevant files are in the same directory) Code:

View Replies View Related

Include Xml (w/ Xsl) In A Asp File?

I'm wondering if there's any way to include a XML file (with a XSL) in a ASP file? I've tried this <!--#include file="publications.xml"--> but the XML-code is included before it is formated according to the XSL and ends up being unformated.

View Replies View Related

Plain ASP Include, No SSI

I'm trying to include a plain html file in my asp page, but don't know how to include since SSI is deactivated(?)

View Replies View Related

Include File With Asp

how would i get something like this to work...

<!-- #include file="<%=Request.GetString("view")%>.txt" -->

i know wat i want and all but i can't figure out how to make it work.

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved