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=something&id=123 executed. Is this possible?!
On site.asp:
dim id
id = 123
if b = "hi" then
server.execute("functions.asp?a=something&id=" & id)
else
response.write("No way dude")
end if
On functions.asp
a = request.querystring("a")
id = request.querystring("id")
if a = "something" and cint(id) > 100 then
response.write("Yes way dude")
else
response.write("No way dude")
end if
You can’t use querystring in
Server.Execute, it’s clearly mentioned in the official documentation.What you can do is much better: you can directly access the variableiddefined insite.aspinsidefunctions.asp, and you can also declare and set another variable,a:–site.asp:
–functions.asp
As it creates whole new “scripting environment” the executed file won’t have access to the calling code properties, methods or variables, only to the global Request parameters, Session etc.
With this in mind, I fear the most simple way around is using Session variable to pass the value between pages:
And then: