Using Server.transfermethod

H

Henry

Hello

I'm using server.transfer() to navigate between pages, and I don't
understand why the URL changes while navigating.

My start page is default.aspx and from a button I want to navigate to
frmAdmin.aspx

so in the onClick event I have the following code
Server.Transfer("frmAdmin.aspx", true)

Which transfer me to the required page, so far so good, browser still
displays the URL .../default.aspx

Now I want to navigate back to the default.aspx
then I try to use Server.Transfer("Default.aspx", false)

Now the browser displays the URL .../frmAdmin.aspx, which is exactlly what I
try to avoid and what I thought server.transfer was meant to do.

Am I completlly wrong here?

cheers
Henry
 
N

Nathan Sokalski

I have never completely understood the second parameter of the
Server.Transfer method, but what happens if you use true the second time?
The few times that I do use the Server.Transfer method (which is only to
automatically display the login page when they are not already logged in), I
use the overload that is just the first parameter. It probably would be good
for me to understand the second parameter better, but until I do, I'm not
going to try to use it. But I would also suggest that you read some of the
articles on Server.Transfer vs. Response.Redirect, Server.Transfer is rarely
used for all navigation.
 

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

Top