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


ADVERTISEMENT

How I Include RSS Feed Into My Website

How I include RSS feed into my website using ASP?

View Replies View Related

Can I Use VBScript In An Include File Statement

I want to include a file in a web page according to some details that are retrieved from a database. I have typed the following code:

<% filename = Session("LModCode") & Session("ClassID") & ".inc" %>

<!--#include file="<%=filename%>" -->

This doesn't work. There is nothing wrong with Session variables that I know of, both values are present when i write them to the page. Is it not possible to use vbscript within an include statement?

View Replies View Related

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

Include A Variable

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

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

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

Variable In SQL Statement

I need to add the following variable into an SQL statement and not sure how to do it. strGCID needs to be inserted into the following statement:

SQL = "SELECT tblContacts.* FROM tblContacts INNER JOIN tblGC ON
tblContacts.GCID = tblGC.gcID WHERE (((tblContacts.GCID)=strGCID))"

i am just not sure of the proper syntax.

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

How To Get Variable = To Loop Statement

I need this variable = to a loop statement

Here is my str

form_bcc = Cstr(If Not objRS.EOF Then objRS.MoveFirst Do While Not objRS.EOF objRS.Fields("Email") Response.Write ";" objRS.MoveNext Loop End If)

And help on how to get this to work?

View Replies View Related

Pass Variable To Sql Statement

I have created a hyperlink in one page (all.asp) using this code:

<a href="cat.asp"><%= rsProds("category")%></a>

How do I create the sql statement in cat.asp to show only the categories listed by the link in all.asp?

I have this in cat.asp so far:

strQuery = "SELECT * FROM biz WHERE category = ' " & strVariable & " ' ORDER BY bizname ASC"

which shows nothing since the string variable had not been passed.

How do I get the hyperlink category name into cat.asp sql query as a variable?

View Replies View Related

If Statement Comparing Variable

I'm trying to use a variable of retrieved via request from a form to select records.I'm pretty sure I am having a basic syntax error or something else basic. I retrieve the variable from a prevous form:

section_id = request("section_id")

I then retrieve some records and run the compare, if i use the actual value it works:
if rsArticles("tbl_articles.section_id") = "1" then

however if I substitute the variable section_id which equals 1 , it fails the compare and moves on to the else:

if rsArticles("tbl_articles.section_id") = section_id then

if I call the section_id value elsewhere it shows that it is set to 1, so I know it's being passed, <%=section_id%> returns 1 . What am I missing?

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

Setting Result Of Sql Statement Equal To A Variable For Further Use

I'm trying to calculate the total time using values from database I run a select statement to find the timein column in my database.

Now how do i assign the result to a variable so that it can be used? There is only going to be one result because i'm checking it against an autonumber field. that is used as time 1. Code:

View Replies View Related

Form Passing Variable -SQL Statement - Matching Data Type

I have a page that calls itself using a form. The form has two select elements. In the sql statement I am attempting to match the values of the select element to populate a recordset.

The two fields in teh Access db are of type Text and of type Integer. What baffles me is that one sql statement works fine and the other returns nothing. I am having the issue matching on the bedrooms.

In the first statement I took out all other doo-doo and just matched bedrooms = request("bedrooms"). On the other one I used p.bedrooms but it keeps turning up empty. 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

RSS Feed

today a client asked me for an RSS feed on their website. I've never done it before. Bascially i've just spend a while on google and worming my way around the web but just cant seem to get my head around how the heck I make this thing work.
I basically want to embed an rss feed on a website in a little section that will act like a news bar. Can anyone describe to me in the simplest possible terms how i do it. Thats an rss feed, as part of a website. Not a descktop application or anything, it needs to be embedded.Im thinking its the morning tierdness thats making me 'not get it'

View Replies View Related

Rss Feed

I would like to create a RSS feed from my Access Database.
I have an Access table for news which has the article title, date, and
story in it. What I would like to do is pull the data from there into an
xml file to create the RSS feed, so when users upload a news story it
automatically updates in the xml file. Can this be done with asp? and where
should I look for more information.

View Replies View Related

What Is RSS Feed?

i am new to this RSS. so can any body tell me wat is RSS feed? wat is the benifit?

View Replies View Related

RSS Feed

I have this statement which produces data from an RSS feed. The statement works well but I'm confused on how to format the {DC:DATE}.The date currently displays like this: 2006-05-22T08:57:00-04:00. I might like something else ie May 22, 2005 or maybe time.

This statement is inside ASP Tags.

ItemTemplate = "&nbsp;<a class='rssLink1' href=" & """{LINK}""" & ">{TITLE}</a>&nbsp;{DC:DATE}<BR>"

View Replies View Related

BBC RSS Feed

I want to put a BBC RSS Feed onto my site, and i dont want to link to a host, i want to link directly onto the bbc site.

View Replies View Related

RSS Feed

where i can find a good explaination of RSS Feed and a example of it a working example of it. I searched google found some articles but it only tells me what RSS is an overview not in depth.

View Replies View Related

RSS Feed

I am looking to set one up for the information on the following page (here ) in the "Forum - Recent Topics" box.

View Replies View Related

RSS Feed - ASP

how to get news RSS feed in asp?

View Replies View Related

Displaying RSS Feed

Firstly, I am not a programmer, so forgive my complete and utter ignorance of all things ASP related.I am trying to display an RSS feed on a website using some ASP which I found on this website - http://www.tele-pro.co.uk/scripts/rs...d_class_dl.htm
I have downloaded the script and running it locally it works (kind of):-

However, when I put this page on my web server I get an error message:-
http://www.ubsigroup.com/testing/

The ASP file is here:-
http://www.ubsigroup.com/testing/rss...ed_class.1.txt

View Replies View Related

Create RSS Feed

how to create the RSS for a static ASP site. I have used CMS before which has buitin feature of creating the RSS. I like to write own RSS for individual pages. The site in question is SIPLNET.COM

View Replies View Related

Reading XML/RSS Feed With ASP

I could post the various bits of code that I've tried to use to get this to work... but it'd be kind of pointless as I haven't gotten very far with either of them (I've run across encoding problems, and problems where it works on the local machine, but not through ASP. I've tried using an XLT doc and without).

View Replies View Related







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