Toon posts:

[ASP] bestand adhv meegegeven variabelen inluden

Pagina: 1
Acties:
  • 40 views sinds 30-01-2008

Verwijderd

Topicstarter
Ik wil het volgende:

Als je de pagina "test.asp?include=iets.html" wil ik zorgen dat iets.html ergens op test.asp geinclude wordt.
Ik krijg het includen wel voor elkaar, alleen niet zo dynamisch als ik het wil.

Het volgende leek me logisch om in test.asp:

code:
1
<!--#include file="<%=request("include")%>" -->


Maar dit werkt dus niet...

Het werkt wel met javascript:

code:
1
<script type="text/javascript" src="<%=request("include")%>"></script>


Alleen kun je met javascript niet gewoon html includen, alleen javascript code...

iemand een idee hoe dit met ASP werkend is te krijgen??

  • NMe
  • Registratie: Februari 2004
  • Laatst online: 11-03 14:33

NMe

Quia Ego Sic Dico.

Derde hit bij Google: http://www.aspin.com/home/tutorial/scriptin/serversi

En daar is dan het eerste voorbeeld deze pagina die het volgende zegt:
The reason that this code listing will not work is because in Active Server Pages the include directives are resolved before the server-side script portions are processed.
en
In order to get around this problem, the Microsoft FileSystemObject Object can be used to load and pass the content of the desired include file into a string variable which can be inserted into the page that is being sent to the client.

'E's fighting in there!' he stuttered, grabbing the captain's arm.
'All by himself?' said the captain.
'No, with everyone!' shouted Nobby, hopping from one foot to the other.


  • XangadiX
  • Registratie: Oktober 2000
  • Laatst online: 25-03 10:55

XangadiX

trepanatie is zóó kinderachtig

zelf een beetje meer moeite doen dus :)

Stoer; Marduq


Dit topic is gesloten.