473,386 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Can I dynamically obtain include files

Hello,
I'm trying to build a part of an application that will use an include file
based on a user's selection (still in ASP 3.0!).
Their selection is stored in a database. I've tried using variables as
either the entire include file or in parts of the include file, but nothing
I've tried works - I.e.:

myTemplate=objRS("template")
<!-- #include file="inc_<% response.write myTemplate %>.asp" -->

Is there any way to accomplish this?

Thanks in advance,
Sue
Jul 22 '05 #1
4 1252
Sue Barth wrote:
Hello,
I'm trying to build a part of an application that will use an include
file based on a user's selection (still in ASP 3.0!).
Their selection is stored in a database. I've tried using variables
as either the entire include file or in parts of the include file,
but nothing I've tried works - I.e.:

myTemplate=objRS("template")
<!-- #include file="inc_<% response.write myTemplate %>.asp" -->

Is there any way to accomplish this?


http://www.aspfaq.com/show.asp?id=2042

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 22 '05 #2
nope. But you can do IF statements. Both files actually get included but
only the one used.
See www.aspfaq.com for details.

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Sue Barth" <Su*@nSytes.com> wrote in message
news:Ov**************@TK2MSFTNGP10.phx.gbl...
Hello,
I'm trying to build a part of an application that will use an include file
based on a user's selection (still in ASP 3.0!).
Their selection is stored in a database. I've tried using variables as
either the entire include file or in parts of the include file, but
nothing I've tried works - I.e.:

myTemplate=objRS("template")
<!-- #include file="inc_<% response.write myTemplate %>.asp" -->

Is there any way to accomplish this?

Thanks in advance,
Sue

Jul 22 '05 #3
Try Server.Execute("myTemplate.asp")
All FORM vars are passed to it and all session vars, application vars,
cookies are available to the script. It's a powerful command.
Read more here
http://www.aspfaq.com/show.asp?id=2042

Regards
Frank

Sue Barth wrote:
Hello,
I'm trying to build a part of an application that will use an include file
based on a user's selection (still in ASP 3.0!).
Their selection is stored in a database. I've tried using variables as
either the entire include file or in parts of the include file, but nothing
I've tried works - I.e.:

myTemplate=objRS("template")
<!-- #include file="inc_<% response.write myTemplate %>.asp" -->

Is there any way to accomplish this?

Thanks in advance,
Sue

Jul 22 '05 #4
This seems to be my answer, thanks so much!

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:uS**************@TK2MSFTNGP11.phx.gbl...
Sue Barth wrote:
Hello,
I'm trying to build a part of an application that will use an include
file based on a user's selection (still in ASP 3.0!).
Their selection is stored in a database. I've tried using variables
as either the entire include file or in parts of the include file,
but nothing I've tried works - I.e.:

myTemplate=objRS("template")
<!-- #include file="inc_<% response.write myTemplate %>.asp" -->

Is there any way to accomplish this?


http://www.aspfaq.com/show.asp?id=2042

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Jul 22 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Chris Powell | last post by:
I am using Excel/Access 2000 and have two large Excel files (25,000 rows each) that I wish to create linked tables in Access rather than importing into Access. The two source Excel files change...
3
by: Quentin | last post by:
Hey there ! I made my own WebControl, that inherits from WebControls, and i added an HtmlTable to it. I would like to include a file, dynamically, to one of its cells... I've already searched,...
4
by: MC D | last post by:
When I dynamically add a control by doing something like dim x as control = Page.LoadControl("myControl.ascx") am I actually loading the control from disk??? I don't really understand why I...
1
by: Dave | last post by:
I have two environments: DEV and PROD. In DEV I have two independent webs. In PROD one of the webs is the root and the other is a subweb of the root. Each enviornment has a different file system...
9
by: Anubhav Jain | last post by:
Hi, I am having few .net source files(.cs or .vb) and I want to dynamically generate the corresponding .net project file(.csproj or .vbproj) for them without using visual studio.So that I could...
2
by: Yarik | last post by:
Hello, I am not sure the subject of my post adequately describes the problem I am trying to solve, so I think a specific example would be helpful. Let's say there are XML descriptions of...
1
by: justin | last post by:
I am trying to make a page that has a drop down list at the top, and based upon the selection in the drop down list, inserts a FormView in the bottom of the page. I tried to create each of my...
1
Merlin1857
by: Merlin1857 | last post by:
How to search multiple fields using ASP A major issue for me when I first started writing in VB Script was constructing the ability to search a table using multiple field input from a form and...
20
by: Nickolai Leschov | last post by:
Hello all, I am programming an embedded controller that has a 'C' library for using its system functions (I/O, timers, all the specific devices). The supplied library has .LIB and .H files. ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.