Response.Redirect or Server.Transfer?

  • Thread starter Thread starter Justin
  • Start date Start date
J

Justin

Hi,

Im confused here over the usage of Response.Redirect and
Server.Transfer. I used frameset for my work, what are the
proper usages of the two methods that seems working
similar..

The problem i faced while using Response.Redirect is that
the page that is directed to, does not looks as
desired..the textboxes are not visible anymore and so as
the fonts which look different.

For Server.Transfer. I cant refresh my page...

The other thing is that; is it possible for me to
redirect / change two frames at the same time..?

Thanks in advance
 
Hi Justin,

Response.Redirect and Server.Transfer are 2 different
systex to form different work.

Response.Redirect would redirect you page to a desired URL
without taking the value of the form from where it is
being redirected. Means you can use redirect method to
link another URL also eg if you are working on site say
justin.com so here you can use redirect method and get
connected to hotmail.com also. Where as in Server.Transfer
you are not doing as redirect, infact in this you have a
hold on the values of previous form and which you can
access at new transfered page.

Note: In server.transfer you can not transfer control
to .htm, .HTML, .ASP page. it's only for .ASPX page.

regarding your doubt of redirecting to 2 frames, what you
can do is you can redirect it to a frameset, but it's not
possible to redirect to 2 different frames.

Hey justine i hope this would help you. Please fill free
to contact if may need my help.

Thanks

Regards
Vivek Jain
 
Response.Redirect sends a response back to the client browser, telling it to
request the page redirected to. Server.Transfer happens on the server-side,
and without the browser being involved, transfers execution of the current
Request to another Page class. How the page redirected to looks has nothing
to do with Response.Redirect; it has to do with your Page Class code.

Changing 2 frames at once is done the same way as with any frameset using
HTML pages. You must use JavaScript on the client to do this. Here's an
example:

function change2frames {
window.parent.frameName1.location = "someUrl";
window.parent.frameName2.location = "someOtherUrl";
}

<a href="javascript:change2frames()">Click here</a>

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Complex things are made up of
lots of simple things.
 
Response.Redirect - sends a redirect back to the browser. This means the
browser does the call for the next page.
Server.Transfer - client ask for page 1 and the server transfer them to page
2 without their knowledge (the address bar still says page1.aspx)

Which to use depends on a lot of factors:

1. Do I want the user to be able to bookmark the second page?
Response.Redirect
2. Do I want to hide the second page? Server.Transfer

It can get much more complex (many more questions).

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
Author: ADO.NET and XML: ASP.NET on the Edge

****************************************************************************
****
Think Outside the Box!
****************************************************************************
****
 
Back
Top