You could use a session variable.
In this particular case, I would still use Response.Redirect as you want to
say to the browser to point to another location (with Server.Transfer the
browser will still show the "old" URL).
IMO, Server.Transfer is rather for those who have processing only pages. It
allows then to transfer the control to a processing only page easily server
side, before perhaps a final redirect to let the browser point to anotehr
final web page (rather than to have several redirects).
Patrice
--
"Julien C." <ch******@hotmail.com> a écrit dans le message de
news:et**************@tk2msftngp13.phx.gbl...
Yep,
I read the parameter with : string source = Request.Params["source"];
I don't want to use Response.Redirect() since it involves another
roundtrip. The interest of Server.Transfer() was that it happens entirely on the
server.
I'd really like to do this using Server.Transfer()
Julien C.
<an*******@discussions.microsoft.com> a écrit dans le message de
news:07****************************@phx.gbl...
Should work!
How do you read the parameter?
string source = Request.Params["source"];
If not ok:
try
Response.Redirect(url);
instead of
Server.Transfer(url);
Seb
-----Original Message-----
Hi Seb,
I already tried and it doesn't work !
Thanks anyway !
Julien C.
"Seb" <an*******@discussions.microsoft.com> a écrit dans
le message denews:06****************************@phx.gbl... Hi Julien,
Server.Transfer("ViewItem.aspx?source=EditItem.asp x");
Cheers
Seb
>-----Original Message-----
>Hi all,
>
>I have an "EditeItem.aspx" page which lets me edit
properties of an "Item".
>In the OnClick() event of my Save button, I do save Item changes to the
>database and then I redirect the user to the Item
page "ViewItem.aspx" with
>a simple :
>
> Server.Transfer("ViewItem.aspx");
>
>I'd like to pass another HTTP parameter so that in
the "ViewItem.aspx" page,
>I am able to know that the user comes from
the "EditItem.aspx". Here's what
>I'd like to do :
>
> Request.QueryString.Add ("RefreshMenu", "1"); // <-- Raises an
>exception
> Server.Transfer("ViewItem.aspx");
>
>Indeed, QueryString (or Form, or Params) are read-only
collection and
>therefore, it raises an exception. How can I pass an
addtionnal HTTP
>parameter ?
>
>Thanks in advance !
>
>Julien C.
>
>
>.
>
.