pure032398
asked on
Server.Transfer: not working =((
Ok. check this out.
simple question.
I try this...
Server.Transfer("/_common/ error.asp" )
Works 100% fine.
Now... when i add some VARIABLES
Server.Transfer( "/_common/error.asp?strErr or=" & strError )
or ANYTHING with a & (even just this...Server.Transfer("/_ common/err or.asp&") and / or some stuff after.. no luck.
i get this error.
The call to Server.Transfer failed while loading the page.
or
Invalid URL form or fully-qualified absolute URL was used. Use relative URLs.
WHAT's GOING ON HERE?!?!?!?!?
-PK-
simple question.
I try this...
Server.Transfer("/_common/
Works 100% fine.
Now... when i add some VARIABLES
Server.Transfer( "/_common/error.asp?strErr
or ANYTHING with a & (even just this...Server.Transfer("/_
i get this error.
The call to Server.Transfer failed while loading the page.
or
Invalid URL form or fully-qualified absolute URL was used. Use relative URLs.
WHAT's GOING ON HERE?!?!?!?!?
-PK-
ASKER
Same error.
Invalid URL form or fully-qualified absolute URL was used. Use relative URLs.
Invalid URL form or fully-qualified absolute URL was used. Use relative URLs.
I have a hunch that you cannot use variables in the Server.Transfer method, since the does transfer the request.querystring or request.form of the parent pages.
If strError is generated as
strError = Request.QueryString("Error ")
you'll probably have to get the value in the transfered page the same way.
Only a SWAG.
If strError is generated as
strError = Request.QueryString("Error
you'll probably have to get the value in the transfered page the same way.
Only a SWAG.
Could you use a Response.Redirect("/_commo n/error.as p?strError =" & strError) instead of Server.Transfer?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you might try putting the URL in a variable, and doing a Server.URLEncode() on it befor the transfer.
ASKER
jbilsten:
Yes. that's what i'm doing now. BUT, the advantage of S.T is that it doesn't make a return request to the client, therefore speeding up transactions, blah blah blah .....
clockwatcher:
Yeah. I could try doing that, but that sorta means i'm going to have to go over lost of my code, making more changes. So i don't want to do that, when response.write can handle it ok, currently.
burntout:
Nop. didn't work either
Server.Transfer Server.URLEncode( "shoppingCartPurchaseFailu re.asp?int Error=1&" & strCCDetails )
resulted in
The call to Server.Transfer failed while loading the page.
I'll give the points to clockwatcher.
Which is depressing, becuase there is no Server.Transfer function, where u can pass it a querystring.
*DAMN!*
-PK-
Yes. that's what i'm doing now. BUT, the advantage of S.T is that it doesn't make a return request to the client, therefore speeding up transactions, blah blah blah .....
clockwatcher:
Yeah. I could try doing that, but that sorta means i'm going to have to go over lost of my code, making more changes. So i don't want to do that, when response.write can handle it ok, currently.
burntout:
Nop. didn't work either
Server.Transfer Server.URLEncode( "shoppingCartPurchaseFailu
resulted in
The call to Server.Transfer failed while loading the page.
I'll give the points to clockwatcher.
Which is depressing, becuase there is no Server.Transfer function, where u can pass it a querystring.
*DAMN!*
-PK-
Actually, you may want to try URL encoding the thing again.
I don't think it will work any better, but the sample you posted definitely wouldn't work right. You don't want to urlencode the whole thing only the variables within the querystring that may cause problems (strings for example). URLEncoding the whole thing is definitely going to give you a messed up URL.
Try:
Server.Transfer "shoppingCartPurchaseFailu re.asp?int Error=1&st rError=" & server.urlencode(strError)
I don't think it will work any better, but the sample you posted definitely wouldn't work right. You don't want to urlencode the whole thing only the variables within the querystring that may cause problems (strings for example). URLEncoding the whole thing is definitely going to give you a messed up URL.
Try:
Server.Transfer "shoppingCartPurchaseFailu
ASKER
hmmm i'm not sure that will work either, becuase if i do this...
server.transfer "xxx.asp?"
i get the error.
so i assumed ANYTHING with a querystring will get me an error. i'll still give it a go and confirm this...
-PK-
server.transfer "xxx.asp?"
i get the error.
so i assumed ANYTHING with a querystring will get me an error. i'll still give it a go and confirm this...
-PK-
Hey I was just looking through an ASP book, and it says that the reason you cant use querystrings is because you don't need to. when you transfer all of your variables are still available.
so if you were going to do something like this
Server.Transfer "file.asp?name=" & Name
you could just transfer and the value of Name should still be there.
so if you were going to do something like this
Server.Transfer "file.asp?name=" & Name
you could just transfer and the value of Name should still be there.
burntout,
That's what MoMarvi and I already said. The Request objects aren't repopulated; they're static-- they don't change from the initial request.
I assumed pure is trying to ADD new information to the request-- to indicate an error condition within a currently executing page and pass that error on into a generic error-handler via Server.Transfer. Server.Transfer isn't designed to be used as if it's handling a new request. It's designed with the one request, multiple chained ASP scripts in mind.
That's what MoMarvi and I already said. The Request objects aren't repopulated; they're static-- they don't change from the initial request.
I assumed pure is trying to ADD new information to the request-- to indicate an error condition within a currently executing page and pass that error on into a generic error-handler via Server.Transfer. Server.Transfer isn't designed to be used as if it's handling a new request. It's designed with the one request, multiple chained ASP scripts in mind.
opps, sorry about that..
ASKER
hehehe
I was trying to Add new information to the request, just like you thought Clockwatcher, so what do i do ???
If ... = 1 Then
intError = 1
'Server.Transfer "shoppingCartPurchaseFailu re.asp?int Error=1&" & strCCDetails
Server.Transfer "shoppingCartPurchaseFailu re.asp"
<next page>
if intError=1 Then .....
Not a problem =)
-PK-
I was trying to Add new information to the request, just like you thought Clockwatcher, so what do i do ???
If ... = 1 Then
intError = 1
'Server.Transfer "shoppingCartPurchaseFailu
Server.Transfer "shoppingCartPurchaseFailu
<next page>
if intError=1 Then .....
Not a problem =)
-PK-
ASKER
Actually, i was wrong. =(
Sorry. Forget what i just said.
intError didn't get populated on the next page....
weird...
??
Sorry. Forget what i just said.
intError didn't get populated on the next page....
weird...
??
You have to use session variables.
what about
strTemp = "/_common/error.asp?strErr
Server.Transfer(strTemp)