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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to run asp code from another asp page 1

Status
Not open for further replies.

hecktic

Programmer
May 14, 2002
84
CA
Hi,

I need some help to figure out something (hopefully, can be done). I have an asp page that basically puts 3 different files together using SSI and asp code to generate one page.

i.e. header.asp + temp.asp + footer.asp

temp.asp will be different depending on which menu the user clicks. The asp code takes care of that.

Now, in temp.asp... the asp code i'm putting doesn't get executed because the browser is getting it as text.

Is there a way to execute asp code inside another asp page?
I've tried putting a javascript alert and that works. But i can't figure it out for asp.

Thanks for any help.
 
oops in vbscript its the execute function (see below)

<html>
<body>
<%
dim str_asp
str_asp = &quot;dim lng_count&quot; & vbcrlf & _
&quot;for lng_count = 1 to 10&quot; & vbcrlf & _
&quot;response.write lng_count & &quot;&quot;<br>&quot;&quot;&quot; & vbcrlf & _
&quot;next&quot;
execute str_asp
Response.write &quot;Done.&quot;
%>
</body>
</html> codestorm
Fire bad. Tree pretty. - Buffy
select * from population where talent > 'average'
You're not a complete programmer unless you know how to guess.
I hope I never consider myself an 'expert'.
<insert witticism here>
 
ahh .. or in your case why not just use server.execute

you can either use fso to read a file into a string and execute that, or server.execute the file itself
codestorm
Fire bad. Tree pretty. - Buffy
select * from population where talent > 'average'
You're not a complete programmer unless you know how to guess.
I hope I never consider myself an 'expert'.
<insert witticism here>
 
is executing the file more efficient that including the js file? :)
 
Yes... executing is server side...js is clientside.
Don't use javascript unless you have to. -Phil
fillup07@hotmail.com
 
Yeah, server.execute works fine. But codestorm's execute works great too. I didn't know we have a function like that. It allows us to build dynamic includes, which I needed a lot in the past. He deserved a star :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top