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

Alternative to server.execute (for IIS4 / asp2)?

Status
Not open for further replies.

JulianUK

Programmer
Apr 17, 2002
73
GB
Hi
I have a piece of ASP3 code and i want to do the equivalent in IIS4 / asp2. Any ideas for an alternative to server.exec?

in iis5:
--------
...shared page HTML...
..
<% if varPage = &quot;menu1&quot; then
server.execute(&quot;menupage1.asp&quot;)
elseif varPage = &quot;menu2&quot; then
server.execute(&quot;menupage2.asp&quot;)
else
server.execute(&quot;mainmenu.asp&quot;)
end if
%>
..etc.
--------

Obviously I can't straight implement some #includes within the IF statement as they are ALL parsed first and regardless of any ASP code.

Is there a regular way around this?

Many thanks in advance for even reading this far.

Julian
 
i believe you can use #includes here but you will need to break out of the ASP tags to do it:

Code:
<% if varPage = &quot;menu1&quot; then %>
<!-- #include file=&quot;menupage1.asp&quot; -->
<% elseif varPage = &quot;menu2&quot; then %>
<!-- #include file=&quot;menupage2.asp&quot; -->
<% else %>
<!-- #include file=&quot;mainmenu.asp&quot; -->
<% end if %>

Tony
reddot.gif WIDTH=500 HEIGHT=2 VSPACE=3

 
Yes, you're right.

That must be subtly different from my attempt when all the .asp files were 'run'. I must've got something wrong.

Its not as neat as i have to have a big 'if', one for each page, but a small trade off I suppose.

Thanks.

Julian.
 
I'll look into that, thanks.

I do have the luxury of not having anyone else here who will look at my code though! (or even anyone who would know what they are looking at!) So I can be as ugly with it as I like!

It does make it kind of difficult to glean ideas from colleagues however, which is why a forum like this is so wonderful!

Julian

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top