468,133 Members | 1,574 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,133 developers. It's quick & easy.

Response.Redirect or Server.Transfer?

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
Nov 17 '05 #1
3 8771
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
-----Original Message-----
Hi,

Im confused here over the usage of Response.Redirect and
Server.Transfer. I used frameset for my work, what are theproper 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
.

Nov 17 '05 #2
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.

"Justin" <yy****@hotmail.com> wrote in message
news:0c****************************@phx.gbl...
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

Nov 17 '05 #3
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!
************************************************** **************************
****
"Justin" <yy****@hotmail.com> wrote in message
news:0c****************************@phx.gbl...
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

Nov 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Paul de Goede | last post: by
4 posts views Thread by Harsh Thakur | last post: by
2 posts views Thread by Nathan Sokalski | last post: by
3 posts views Thread by jasonheath.net | last post: by
27 posts views Thread by didacticone | last post: by
1 post views Thread by gcdp | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.