Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dynamic content

Status
Not open for further replies.

bellmd

Programmer
Sep 28, 2000
15
0
0
GB
I am trying to create a two page system which has one page displaying a list of articles and a second which displays the the individual articles, selecting them from information in the querystring. I tried to use a server side include, although it's writen to the page it does not get executed. [sig][/sig]
 
I believe we will need to see some code. What is the include for? Is it for page layout? Does it define the article to be displayed? Is it in the correct place to do anything? etc.
[sig]<p>Rob<br><a href=mailto:robschultz@yahoo.com>robschultz@yahoo.com</a><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
"Focus on the solution to the problem,<br>
not the obstacles in the way."<br>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[/sig]
 
The include is for the content of the page. Here is the code which isn't working.

Code:
....
<%
newsid = Request.querystring(&quot;id&quot;)
....
set newsSet = lawtalkDB.Execute(&quot;select * from news where id=&quot;&newsid)

thePage=&quot;<!--#include virtual='&quot;
thePage=thePage&newsSet(&quot;location&quot;)
thePage=thePage&&quot;'-->&quot;
%>
....
<!--#include virtual='LawTalk/standardtop.txt'-->

<h2><%=newsSet(&quot;title&quot;)%></h2>

<%Response.Write(thePage)%>

<!--#include virtual='LawTalk/standardbottom.txt'-->


The includes for the top and bottom of the page are fine, and Response.Write(thePage) writes the include to the page that is sent out rather than executing it. [sig][/sig]
 
Ahhh. Ok, here goes...

A) You can't use includes in the way it seems you want to. You are doing a write to the html stream of an include directive. The include directive only works at the server (asp) level.
B) You can't use the include directive for any large number of choices as the includes are processed before anything else. That means that if you try to use a variable in the include line it won't work as it doesn't know what the variable means. If you try to use a select/case or if/else statement then EVERY article is loaded to the client browser.
C) You would be better off with one of the following...
1) If your clients will only use 4+ browsers then you can use IFRAME and ILAYER to display content 'on the fly'.
2) If your clients will use anything else then you could store your html in a database field and display the record with a response.write statement. CSS would work well here as you could use headers and the like in the database record and change just the html css to change the layout of the page.

Basically, for this particular problem, forget about using includes.

Hope it helps, [sig]<p>Rob<br><a href=mailto:robschultz@yahoo.com>robschultz@yahoo.com</a><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
"Focus on the solution to the problem,<br>
not the obstacles in the way."<br>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[/sig]
 
Thank you very much Rob and Nick, your help has been great. I'm not sure what the site will be run on eventually, so I can't say if it will be using IIS 5, although I imagine that it will. I think that either using IFRAME or ILAYER is my best bet.

Cheers,
Matthew
matthew@sexycooking.co.uk [sig][/sig]
 
Yo, Nick! I'm using IIS 5.0 (at least on my dev box). Give it up. Whats the secret? (-I

[sig]<p>Rob<br><a href=mailto:robschultz@yahoo.com>robschultz@yahoo.com</a><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
"Focus on the solution to the problem,<br>
not the obstacles in the way."<br>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[/sig]
 
OOOoooooo! Sad thing is, I've been using IIS 5 (and have had an ASP 3.0 poster up) for months now but have been using IIS 4 techniques (since production is IIS 4). I will certainly be using the server.execute and server.transfer methods in the near future.

Thanks for the knowledge, [sig]<p>Rob<br><a href=mailto:robschultz@yahoo.com>robschultz@yahoo.com</a><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
"Focus on the solution to the problem,<br>
not the obstacles in the way."<br>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top