Click to See Complete Forum and Search --> : problem with Server.Transfer


jasonli
July 25th, 2006, 02:49 PM
I use Server.Transfer to navigate between web page 1(page1.aspx?verb=view) and web page 2(page1.aspx?verb=edit). But the problem is address bar showed wrong address while the querystring was correct.

in page1.aspx?verb=view, I run Server.Transfer("page1.aspx?verb=edit", false), address bar still show "page1.aspx?verb=view".

Fishdawg65
July 25th, 2006, 03:01 PM
That appears to be by design.

Take a look here (http://www.developer.com/net/asp/article.php/3299641). Why not use Response.Redirect if you want the url to change?

jasonli
July 25th, 2006, 03:47 PM
Thank you for your reply, Fishdawg65.

Server.Transfer could maintain the address. But not really.
e.g., I navigate from 1.aspx to 2.aspx and then to 3.aspx. In 1.aspx, address bar shows "1.aspx"; in 2.aspx, address bar shows "1.aspx"; in 3.aspx, address bar show "2.aspx" (not "1.aspx" as I expected).

Can you figure it out?

Fishdawg65
July 25th, 2006, 04:13 PM
To be honest, I don't know the exact answer. My simple guess is that since Server.Transfer creates a new Response object that it can only store 2 "page" objects in it and therefore updates the url after the second click.

If you do find this out, I'd be interested in hearing it.