Passing a parameter through server.execute?

后端 未结 4 760
南笙
南笙 2021-01-12 09:34

It is possible to pass a parameter through server.execute?

Fx. I have in my site.asp an IF-scenario where I need functions.asp?a=some

4条回答
  •  北恋
    北恋 (楼主)
    2021-01-12 09:42

    Why not to use #include instead of server.execute?

    I looked for a difference and found that in this particular case, using #include is the best solution: https://en.wikibooks.org/wiki/Active_Server_Pages/Server-Side_Includes#What_it_Does

    You need some variables defined in parent page to be used in child, so your solution could be:

    dim id, a
    id = 123
    a = "something"
    if b = "hi" then
        
    else
        response.write("No way dude")
    end if
    

    On functions.asp

    if a = "something" and cint(id) > 100 then
    response.write("Yes way dude")
    else
        response.write("No way dude")
    end if
    

    Advantages:

    • Simply act as it was the same page.
    • Use of disposal variables instead of Session variables.
    • Don't show internal variables in main URL.

提交回复
热议问题