Alternatives - Can't Use Dynamic Includes

I'm well aware that you can't use dynamic includes (eg: <!--# include file="path/<%=strPath %>"-->) due to process order in ASP, but I really need to find a work-around.

I can't use TextStream because the files will need to execute.

Server.Execute causes a "Type Mismatch" in the script it executes that functions fine under normal circumstances so I don't know why - though admittedly I'd rather not use this method (it's well documented to be not a very good idea anyway!) so I haven't tried too hard to fix that issue...

All I want to do is say "If a file exists, execute it - if not, do nothing!" Here's my (broken) code - this represents what I would like to achieve though obviously this example will never work because of the required dynamic include. Anyone got any genious ideas to achieve the same results as this script would if it worked? Code:

View Replies


ADVERTISEMENT

Dynamic Includes From URL

Is there any way to dynamically generate an include file based on a variable passed to the asp page via a url ?- so for example:

Person x clicks on a url - that ur directs them to template.asp (template.asp has no code in it other than page title etc and <!--#include file="<%variable%>" --> )

Once in template.asp the page loads the include file that is relevant to the companies website that the link was clicked from.

In that include file will be the correct form and stylesheet setting for that company.

What we are trying to do is achieve a global template file which multiple customers can direct peo[ple through and all the data is therefore stored in one central repository.

The file displayed when they reach template.asp will depend on the url they clicked. Basically how can i get the url to pass the variable which the include file will then load??

View Replies View Related

Dynamic Includes

how can i include aspp files dynamically using

<!-- #include file="somefile.asp"-->

View Replies View Related

Dynamic Includes

I am currently working on a template that will be replicated over 200 sites or so. The first of these have been interesting. I'm trying to work out the best ways to replicate these sites and need help with a left sidebar containing links to the first 40 sites. Go to carpetbid.com or spabid.com. I tried doing an include over multiple sites but have read a lot about it and see that this doesn't work.What should I do?

View Replies View Related

Secure Dynamic Includes

Is there a way to make this script more secure?

I usually do my coding in php where i can strip slashes and tags to prevent evil code from being included.

can something similar be done with asp?

<%
dim pid
pid = Request.QueryString("pid")
if pid = "" then
fil = "content/page1.asp"
else
fil = "content/" & pid & ".asp"
end if
Server.Execute(fil)
%>

View Replies View Related

Dynamic Includes Of Asp Code

I have seen the discussion below of how to use dynamic includes to get the info into the page.

I am currently using an include to pull in a file containing user defined variables in vbscript. I pull these into the page which lets the user set certain variables without touching the ASP. Code:

View Replies View Related

How To Do Internationalization In Classic ASP (w/o Dynamic Includes)?

I'm using classical ASP on IIS 6.0 (Windows 2003 Server). What I want to do is to serve the same pages in two different languages without using two different folders and doubling my same ASP code and changing the string values.

What I need is DYNAMIC INCLUDE functionality similar to PHP, however I know that I don't have it in ASP. Moreover Server.Execute is useless because it doesn't have a functionality like an include file, calling some file (that includes language string constants) conditionally is not useful because when the file is executed its scope is over and I cannot reach the constants or variables defined in that file.

What do you advise in such a situation? I need two groups of constants, one for English, one for Turkish, like: ....

View Replies View Related

Alternatives To IIS

I've gone through similar threads, but I'm thinking maybe the process of time has reaped a solution. Basically, is there anything besides IIS that will run on windows 2000 desktop.? Pws wont work, webmatrix is for asp.net (not classic asps). So does anyone have a solution? I can't use IIS.

View Replies View Related

Session Alternatives?

I was wondering if anyone had a good alternative to Session variables.

Background: Basically, I'm coding a personals site for someone, and obviously, there's member and non-member areas. For development, I'm doing the member tracking with a Session variable, but was wondering if there were alternatives for the non-cookie user.

The only other idea I came up with is in my IsLoggedIn function (the one that looks for a Session object and redirects to the login page if it doesn't exist or times out), was to log the user's IP address/timestamp in a DB table, then do a read comparison on their IP address, compare the timestamp to Now() and update the log table with the current time. The problem is, that's one extra search, read, and write for every page the member visits, and I'm concerned about this extra overhead slowing the site down.

I'm also hesitant to create a GUID and pass it in the URL string as these can be faked, plus get messy with respect to pass-through data, etc.

SSL is also out of the question, as the owner doesn't want to buy a certificate, plus this can slow a site down worse than the IP method illustrated above. The site is hosted on Win2K Advanced Server and SQL Server 7 backend.

View Replies View Related

&nbsp Alternatives

Are there alternaives to using the &nbsp tag for spacing out text within the same line?

View Replies View Related

Sessions Unreliable - Alternatives?

I have shared hosting at GoDaddy. Every 12 hours they reset IIS in my application pool. This means that anyone logged in when this happens has to log in again. Also, if they submit information after the restart happens they lose all the information.

Are there any alternatives to sessions that won't be affected in case of an IIS reboot? Code:

View Replies View Related

ShowModalDialog Problem When String Too Long - Any Alternatives ?

I am displaying a modal dialog in JScript using window.showModalDialog
passing a long string as URL - i.e. it contains variables values just
like a Get request. Problem is that string is now tool long and
showModalDialog fails. I'm aware of the DialogArguments and passing an
object to receiver but this is no good for me as the receiver needs to
access the long string in server side code and so would not know
anything about the dialogArguments class. Can anyone suggest a way for
me to show the dialog as modal and at same time get the long string into
the dialog and have the string accessable from both server side code and
client side within the dialog recever file ?

View Replies View Related

ASP Includes?

As im used to using php im not to famillier with asp Is there such thing as a asp include? and how would i do it?

View Replies View Related

Includes

I have a folder structure that looks something like this.

root
->inc
->files
->system
->->area
->->group
->->->Layer3

etc.

I want to add a include file from the original folder level from the "inc" folder.
The file of where the include will be used is located within the folder named Layer3 folder.

How do I add in the include referencing the file.
Do i just use".."

For every folder level i want to go up to gain access to the file?
Do i just continue to add ".."?

View Replies View Related

ASP Includes

My web designer created my site with a header include or something to that effect. My question is this: How do I change each page title to what I would like for SEO purposes? When I put the desired title onto each page, my includes/header.asp file "overwrites" the desired title; thus, every static page has the same title. Creating separate include files would work but would take forever. I have even tried leaving the title tag blank in the includes.asp file and add the desired title to each static page, but the title tag doesn't end up in the <head>, just the <body> tag.

View Replies View Related

Xml Includes

I have a XML file that I've formatted using xsl. now I'd like to include that xml just like a normal file in an asp page.

I have the following code but it's really buggy and sometimes it works and sometimes it doesn't, really confusing!!! Code:

View Replies View Related

Includes

When writing ASP pages that have include pages, is best to make the include pages as txt, asp, inc??? which format would be the most efficient.

View Replies View Related

Includes

I've a big include asp file with a lot of function and subs, some of them with a long html code embebed, in this intranet and I'm not sure if I should break it in a several include files in order to improve the performance.

My question is:

leave it as it is because all that code runs into memory only once , say at log in, or
break it in several others, in order to access the code that really is to be accessed.

View Replies View Related

Includes

I have a table that I am using as a main skeleton for all my pages to use. The problems is that I want other pages to be inserted into a specific cell.

I have a skeleton.asp with 2 rows and 2 columns. I will create pages like company.asp which will have just text in them and they will use the include tag and include the skeleton.asp.

The problem is that I want the text only page to be inserted into the lower right cell on the table in the skeleton.asp. I have seen it done many times but I cannot remember what the tag was that you put in the cell to put the include contents there.

View Replies View Related

Includes

I have a page that uses includes.It has 1 include to bring in a header, 1 for the menu, and then there is a content area.

This content area I need to change.So, for example, the link would be index.asp page=aPage.asp and it would load my page that page witht the header and menu and for the content area include aPage.asp.

What is the script I can do this with. I tried simply using Response.Write and then just righting the <! #include --> tag with the right page in there, but it just writes that without parsing it and including that page.

View Replies View Related

Includes And CSS

I have an include, which is used as the header of my site, that has a bit of CSS coding in it. The CSS code along with an unordered list creates an expandable menu. The include works great when you view it at its URL, but the menu doesn't expand when a person has to access dynamic pages.

I have found out that the problem is that when the file is included the code is not inside the <head> tags, so thus the menu doesn't perform, or expand. Is there any snippet of code that could automatically put the CSS inside the <head> tags?

View Replies View Related

Includes Like ISS

I have made my asp pages but the left side navigation menu I want to be an include so if I ever change a link it's easy to update them all by changing the nav.asp file. How can I include the nav.asp file on the other asp sites like adminpanel.asp .

View Replies View Related

Includes

Can someone comment on the use of SSIs? Do these place a lot of strain on the server?
Also, are "virtual" includes or "file" include directives more efficient?

View Replies View Related

Includes And ASP

I am writing a mail order site using includes and nested includes for ASP code. I have no idea if this is rendered without error in all browsers. Does anyone have any idea on this? Code:

View Replies View Related

Dynamic Calendar, Need To Create Dynamic Array....

I code that creates a calendar for each month and then it displays events from that month that are stored in a db. I need to loop through my recordset and display all the events, but I can't quite figure out how to do it. I am thinking I need to do an array. But I am not really sure.... any ideas. Here is where you can view the calendar. Code:

View Replies View Related

2 Asp Includes, And One Depends On The Other

I have a main file (asp), from which I include 2 different asp files. The second included asp file references an array element deefined and populated in the first include asp file. However, the array value is not being resolved in the second include.

This is not on a Windows server, but rather a UNIX server. However, the host provider claims ASP and SSI support.

View Replies View Related

How Do Includes Affect?

if there are alot of include file in ASP pages, what happens? the so much include files,the diffucult page load ?

View Replies View Related

<iframe> And Asp Includes?

saddled with using an <IFRAME> area on a classic asp page from the designer, so I'm trying to find out the following.

on that page I usually use the <IFRAME> to hold a simple HTML page, that the client will have access to from my CMS program so they can make edits, updates etc.

but, one page has a search functionality, written in classic ASP and using MS-Access dbase to find members of the association etc.

when I put the asp search page inside the <IFRAME> src , it wont show? ie --
<iframe src="findlawyer.asp" frameborder="No" width="756" height="427" id="iFrame" vspace="10">

-- should mean that the page findlawyer.asp should show up inside the holding ASP page (called simply find.asp)

why? when I look at the findlawyer.asp page online it shows up perfectly and works perfectly too....yet inside the <IFRAME> it refuses to show up???

View Replies View Related

Nesting Includes In Asp

would there be a limit to the amount of nesting one can do with includes in asp? what would be a good rule of thumb?

View Replies View Related

Conditional Includes

Will this work in asp 3.0:

If True Then
<!-- #include file="test1.asp" -->
Else
<!-- #include file="test2.asp" -->
End If

View Replies View Related

Runtime Includes

I need to include an .asp file into another .asp at runtime, but I need to do it based either on data returned from a dB or from the querystring. Since Server Side Includes happen before any script code is processed I can't accomplish this task using SSIs. At least not that I'm aware of.

The intent is to get a custom style sheet and/or theme design template based on who the user is or which site their visiting e.g. site1.domain.com has a default template of clouds and site2.domain.com has a default template of water, but both may be set by the user to their template choice.

View Replies View Related

Includes And Stylesheet

I have an index page (home.asp) that calls several includes to create the whole page (ie side.asp, top.asp, body.asp). If I externally refer to stylesheets in my homepage, they don't seem to transition into my includes. I can put a <head> on each of my includes and put the internal CSS there. This works, but doesn't seem right, and looks funny in source code seeing multiple <head> tags.

recommend a good tutorial for intermediate CSS? I read Yahoo's source code and I don't understand a lot of what they're doing there... I feel like I'm just a few steps behind understanding that.

View Replies View Related

Includes With Variables

I'm trying to create some includes with vars from the query string, but it's not going well. Lets say i get some vars from the url ['lang' and 'page'], sanitise them, and then try to use them in the include. I've tried all sorts . Code:

<!--#include file="<%=lang%>/<%=page%>.asp"-->

Code:

Response.Write("<!-- #include file=""+lang+"/"+page+"" -->")

but nowt seems to work.

View Replies View Related







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