template.asp for site

I want to do a template.asp file wich get vars
and loading the appropriate file
something like:
template.asp?page=content.asp
the content.asp will be loaded in the template.asp that includes the nav bar etc.
I tried #include option but it cant get vars

Comments

  • Use Server.Execute instead. It can't accept parameters as a part of url though, but inside the included (executed) file you have access to all variables defined in the parent, along with QueryString

    [b][italic]Philip Patrick[/italic][/b]
    [b]Home page[/b]: http://www.saintopatrick.com
    [size=1][italic]"Two beer or not two beer?"[/italic] [b]Shakesbeer[/b][/size]

  • So if I understood corectly
    I can use Server.Execute(template.asp?page.asp)
    but not Server.Execute(template.asp?page.asp?id=3)
  • Nope, you can't use parameters with Execute, but all parameters inside parent script available.
    Imaging you have the first (parent) file with this code:
    [code]
    '****** Parent file *******
    dim a
    a = "myfile.asp"
    Server.Execute second.asp
    [/code]
    And the child (second.asp) file:
    [code]
    '****** Child file ********
    Response.Write a
    [/code]
    the value of "a" will be "myfile.asp" :)

    this is the way it works, but beware because Server.Execute is available only in IIS5+. Not sure it runs on PWS

    [b][italic]Philip Patrick[/italic][/b]
    [b]Home page[/b]: http://www.saintopatrick.com
    [size=1][italic]"Two beer or not two beer?"[/italic] [b]Shakesbeer[/b][/size]

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories