Doubt on Response.Redirect

Results 1 to 4 of 4

Thread: Doubt on Response.Redirect

  1. #1
    kishore Guest

    Default Doubt on Response.Redirect

    hi,<BR> Whether execution continues after Response.Redirect in an Asp Page.<BR>I tried for a sample program having 2 asp <BR>viz. Page1.asp and page2.asp<BR><BR>Page1.asp contains<BR>&#060;%<BR>session("one")="SS1"<BR>Res ponse.Redirect "page2.asp"<BR>session("one")="SS2"<BR>%&#062;<BR> <BR>Page2.asp contains<BR>&#060;html&#062;<BR>&#060;body&#062;<B R>&#060;%<BR>Response.Write (Session("one"))<BR>%&#062;<BR>&#060;/body&#062;<BR>&#060;/html&#062;<BR><BR>when I invoke Page1.asp I get output as SS1 but I was expecting SS2<BR>

  2. #2
    CPeinado Guest

    Default RE: Doubt on Response.Redirect

    Once you Redirect to page2.asp, page2.asp has control of what happens. And unless you Redirect back to page1.asp, you won&#039t go back. If you simply want to execute a part of page2.asp you may want to use Server.Execute (IIS 5). <BR>Otherwise, you&#039ll have to send in your variables in the querystring to page2.asp<BR>Claudia

  3. #3
    Anur Chandran Guest

    Default RE: Doubt on Response.Redirect

    On page1 ,once the execution reaches the response.redirect,the execution itself is transferred to the second page ,and it continues there. SO it is clear that the statements after the response.redirect in the first page is not executed. So there is no point in expecting the second value (value set for the second time) to be displayed in the next page.

  4. #4
    Join Date
    Dec 1969

    Default SS1 is correct

    Res.Red is efectively a goto, processing of the current page stops and processing begins anew on page2.<BR><BR>This means you should do clean up before redirecting ...

Posting Permissions

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