Professional Web Applications Themes

Response.Redirect or Server.Transfer? - ASP.NET General

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

  1. #1

    Default 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
    Justin Guest

  2. #2

    Default Response.Redirect or Server.Transfer?

    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
    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
    >.
    >
    Vivek Jain Guest

  3. #3

    Default Re: Response.Redirect or Server.Transfer?

    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
    [url]http://www.takempis.com[/url]
    Complex things are made up of
    lots of simple things.

    "Justin" <yyf_plhotmail.com> wrote in message
    news:0cff01c35747$d6b70900$a101280aphx.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

    Kevin Spencer Guest

  4. #4

    Default Re: Response.Redirect or Server.Transfer?

    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" <yyf_plhotmail.com> wrote in message
    news:0cff01c35747$d6b70900$a101280aphx.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

    Cowboy \(Gregory A. Beamer\) Guest

Similar Threads

  1. Issue with Response.Redirect / Server.Transfer
    By Craig Douglas in forum ASP Components
    Replies: 1
    Last Post: November 18th, 05:56 PM
  2. Response.Flush / Response.Redirect
    By Richard N. in forum ASP
    Replies: 1
    Last Post: October 19th, 01:06 AM
  3. Response.Filter not working on Server.Transfer
    By Paul de Goede in forum ASP.NET General
    Replies: 5
    Last Post: August 21st, 07:04 AM
  4. Response.Write and Response.Redirect
    By Matthew Wieder in forum ASP.NET
    Replies: 4
    Last Post: July 17th, 05:33 PM
  5. Replies: 1
    Last Post: July 1st, 03:33 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139