[thelist] server.transfer

Martyn Haigh martyn.haigh at virgincosmetics.com
Mon Feb 3 09:12:00 CST 2003


>
> Ok .. I'm trying to be a good lil' programmer .. and used server.transfer
> instead of response.redirect .. (see the caveat in Matty's article
> http://evolt.org/article/Forms/17/10199/index.html .. at the bottom).

Good good - always good to try and better your own programming skills!
>
> Well, what's happening is .. it's including my header twice .. and the url
> doesn't change from login.asp to welcome.asp .. which is where I want them
> to go.

This sounds like your login page and your welcome pages both have headers
(the same?)?

> Is this the expected result and I'm misunderstanding what server.transfer
> is used for .. and I'd be better off just using response.redirect to
> welcome.asp page as that's where I want them to go.

No no - heres a short run down for you :
Response.redirect - the server sends a message to the web browsers, which in
turn sends a message back to the web server asking for the specified page.
This is like loading a new page - but without the user clicking on anything.
(client side re-direct)

Server.transfer - the server includes the called page into the current page.

Similar to response.redirect - but it allows the called page access to all
variables and request collections, and the user does not see any difference.
(server side redirect)

For example if I had :

a.asp
<%
response.write("1")
server.transfer("b.asp")
response.write("3")
%>

b.asp
<%
response.write("2")
%>

when a.asp is called the output would be
12

notice 3 does not get written - this is because the calling page (a.asp)
does not regain control after the called page has finished executing.

Hope this has helped a little.

M


DISCLAIMER: The information in this email is confidential and may be legally
privileged. It is intended solely for the addressee. Access to this email by
anyone else is unauthorised. If you are not the intended recipient, any
disclosure, copying, distribution or any action taken or omitted to be taken
in reliance on it, is prohibited and may be unlawful.





More information about the thelist mailing list