Server.Transfer

  • Thread starter Thread starter Moheb Missaghi
  • Start date Start date
M

Moheb Missaghi

Hi,

I am getting the following error when using
Server.Transfer:

System.ArgumentException: Invalid path for child
request 'https://....'. A virtual path is expected

I am using Server.Transfer("https://...", true). The path
in question is a valid url on the internet. Any idea?

Thanks,

Moheb
 
Moheb,

Server.Transfer requires a virtual path. Meaning that you can't specify http
or https in front of the path given.

You need to specify the path like: "mynextpage.apsx" or
"/admin/myadminpage.aspx"

If you need to Server.Transfer through a site using https you'll have to
enter a page with a response.redirect(https://myentrypage.aspx) and then
server.transfer from there to retain the https.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
 
Justin,

I can use Redirect instead of Transfer (there is no need
for an extra page). What I am trying to do is to send the
contents of the Form collection (hence the second arg is
set to true). This has worked before, I don't know what
the problem is now.

Thanks,

Moheb
-----Original Message-----
Moheb,

Server.Transfer requires a virtual path. Meaning that you can't specify http
or https in front of the path given.

You need to specify the path like: "mynextpage.apsx" or
"/admin/myadminpage.aspx"

If you need to Server.Transfer through a site using https you'll have to
enter a page with a response.redirect
(https://myentrypage.aspx) and then
 
Moheb,

What Justin says is true. it cannot work if you specify
http or http thats because, transfer works within the
worker process and thus it can transfer the form
collection to the next page without having to use
querystring or things like that. if in case if you are
allowed to use http, then you might want to use any URL
which may not belong to the same server.

regards
 
Back
Top