Server.Transfer

A

Andrew Robinson

Quick question....

Can I user Server.Transfer between two different web sites on the same
server? And pass data via the Context object?
 
J

Juan T. Llibre

re:
Can I user Server.Transfer between two different web sites on the same server? And pass data via
the Context object?

Andrew,

No. The source and target pages must be in the same Web application if you use Server.Transfer.
If you want to send the user to a different application, use Response.Redirect.
 
S

Steven Cheng[MSFT]

Hello Andrew,

I agree with Juan. Server.Transfer will work on pages within the same
ASP.NET application and the two pages(source , target) will be executed on
the same httprequest pipeline, that's why we can share data through the
Context.Items collection.

For redirection between pages in separate application or server,
"Response.Redirect" is the recommended and common means. And if you want to
pass some simple data, you can use the QueryString parameters. Is there any
particular requirement or concerns that prevent you from using
Response.Redirect and querystring in your scenario?

Anyway, please feel free to post here if you have any further questions
that we can help.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 
S

Steven Cheng[MSFT]

Hello Andrew,

Does the information in our previous rely help you some? If there is any
further questions on this, please feel free to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,710
Latest member
bernietqt

Latest Threads

Top