Response vs Server ???

G

Guest

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
 
B

Brock Allen

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.
 
G

Guest

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
 
B

Brock Allen

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).
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top