Link to home
Start Free TrialLog in
Avatar of khongkham
khongkham

asked on

Server.Execute not working?

myfile = "product_form.asp?mode=add"
Server.Execute(myfile)

the above code giving error:

Error Type:
Server object, ASP 0231 (0x80004005)
Invalid URL form or fully-qualified absolute URL was used. Use relative URLs.

pls help me! thanks a lot!





Avatar of cybermoonlight
cybermoonlight

You can't pass dynamic values with server.execute, so you cqan't pass a querystring
Online documentation is wrong..plz follow this link to what MS has to say:
http://support.microsoft.com/support/kb/articles/Q247/4/20.asp

There you go
Avatar of khongkham

ASKER

then, what's the correct method to pass the mode value???
ASKER CERTIFIED SOLUTION
Avatar of CJ_S
CJ_S
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
YOu cannot pass arguments to a file being executed through the Server.Execute method. The querystring of the calling file is available inside the the file being called.

so if inside a.asp?xyz=1

you say Server.Execute(thisfile.asp) then inside of thisfile.asp you can say
Request("xyz") and it will return 1

.execute excutes the contents of a page in another page (much like calling a function) so using response.redirect might not be the way. depending on how you are formatting.
could you explain a little more as to what ur tryinmg to acheive?
thx
Continue to use the server.execute method....but leave off the querystring variables... instead create a local variable before doing the server.execute....your "product_form.asp" will then have access to that variable.

example...

mode="add"
Server.Execute("product_form.asp")

now in your product_form.asp you can use the "mode" variable without doing anything like Request.Querystring...just use the variable as if you were in the origional page

hope that helps
Are you working with asp2.0 or asp 3.0
Asp 2.0 does not support this method. It is supported on asp 3.0.
Hope it helps finds the error.

Thanks
May i just comment that response.Redirect is not an altewrnative of server.execute..server.execute executes a page as if it were part of the original page..just like a subroutine..