filename = "file.asp?id=" & ID
Server.Execute("filename")
This doesn't work... Any ideas ?
Well, first of all, because you used
Server.Execute("filename")
you are asking to execute an asp page named
filename
When you put quotes around ANYTHING, you make it into a *STRING*. And then
the value of the string *IS* the stuff inside the quotes.
What you probably *MEANT* to do was
filename = "file.asp?id=" & ID
Server.Execute filename ' NO QUOTES! And the parentheses are optional
BUT...
But that still won't work.
Read the docs:
http://msdn.microsoft.com/en-us/library/ms525849(VS.85).aspx
I quote from the "Parameters" section of that page:
"Path
A string specifying the location of the .asp file to execute. The Path
parameter may be for either an absolute or a relative path. If Path is
absolute, it must map to an ASP script in the same application as the calling
..asp file. Path can be a string variable name that is set at run-time. The
Path parameter must not contain a query string, or IIS returns an error."
One more time:
"The Path parameter must not contain a query string, or IIS returns an error."
'nuff said?
The only good way to send info from the root page to the one requested via
Server.Execute is via a session variable.
Maybe something like this:
Session("ExecuteID") = ID
Server.Execute "file.asp"
And then your "file.asp" page would need to know to get the ID via
ID = Session("ExecuteID")
I should note that Server.Execute is enormously inefficient. It's fine for
lightly loaded sites and/or pages, but it's not a good idea on heavily used
pages (say those hit more than 2000 times per hour? just as a rule of thumb).