Home > Archive > ASP .NET > September 2005 > Response vs Server ???
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Response vs Server ???
|
|
| serge calderara 2005-09-29, 7:01 pm |
| Dear all,
I have a problem to identify when I need to use
Response.Redirect("mypage.aspx") or Server.Transfert("myPage.aspx") ?
Does any one have any tips for remembering ?
regards
thanks
serge
| |
| Brock Allen 2005-09-29, 7:01 pm |
| Server.Transfer switches to the other page mid-request from the client's
perspective. Since it's all server side, the client has no idea the server's
done this. The URL in the browser will be the first page.
Response.Redirect sends back a 302 (IIRC) and a location for the new page
to request. So the browser makes a second request into the server for the
other page. The URL in the browser will be that of the second page since
the browser had to make the second request.
-Brock
DevelopMentor
http://staff.develop.com/ballen
> Dear all,
>
> I have a problem to identify when I need to use
> Response.Redirect("mypage.aspx") or Server.Transfert("myPage.aspx") ?
>
> Does any one have any tips for remembering ?
>
> regards
> thanks
> serge
| |
| serge calderara 2005-09-29, 7:01 pm |
| Thanks brok for your answer, but I forgot to tell you that I am beginer in
asp and I did not catch what you are saying, do you have a simple way ?
When I should use one compare to the other?
I am just learning ASP and try to understand clearly each things in order t
prepare my exams. And as long as one thing in not clear in my mind I am not
able to go further.
Thanks if you cold clarify your answer for a beginner
regards
serge
"Brock Allen" wrote:
> Server.Transfer switches to the other page mid-request from the client's
> perspective. Since it's all server side, the client has no idea the server's
> done this. The URL in the browser will be the first page.
>
> Response.Redirect sends back a 302 (IIRC) and a location for the new page
> to request. So the browser makes a second request into the server for the
> other page. The URL in the browser will be that of the second page since
> the browser had to make the second request.
>
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>
>
>
| |
| Brock Allen 2005-09-29, 7:01 pm |
| In that case, I'd suggest using Response.Redirect -- I use that much more
than I use Server.Transfer. In essence it's simply saying that your page
has decided that the user should go somewhere else (to a different page).
-Brock
DevelopMentor
http://staff.develop.com/ballen
[color=darkred]
> Thanks brok for your answer, but I forgot to tell you that I am
> beginer in asp and I did not catch what you are saying, do you have a
> simple way ?
>
> When I should use one compare to the other?
>
> I am just learning ASP and try to understand clearly each things in
> order t prepare my exams. And as long as one thing in not clear in my
> mind I am not able to go further.
>
> Thanks if you cold clarify your answer for a beginner
>
> regards
> serge
> "Brock Allen" wrote:
>
|
|
|
|
|