Use of Response.Redirect in ASP Classic

Leifoet 1 Reputation point
2022-09-26T14:37:02.543+00:00

With this code in program A
Response.Redirect "prog B"
subprogram B is called (and executed)

Ask :

How does the focus return to program A after finishing prog B ?
Was of the opinion that the focus (after finishing B) automatically returned to A.

Does this require some additional code in A or in B ?

Thanks
Leifoet

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,254 questions
{count} votes

3 answers

Sort by: Most helpful
  1. AgaveJoe 26,201 Reputation points
    2022-09-26T15:43:47.84+00:00

    How does the focus return to program A after finishing prog B ?

    B must do a redirect back to application A.

    Was of the opinion that the focus (after finishing B) automatically returned to A. Does this require some additional code in A or in B ?

    Yes, you must write code. It sounds like you should probably learn what a redirect is and maybe HTTP GET and POST.

    302 Found
    HTTP Request Methods

    The Response.Redirect returns a 302 (or 301) HTTP response where the location header is set to a target URL. When the browser receives the HTTP response it does an HTTP GET to the target URL found in the location header. This is similar to clicking a link.

    0 comments No comments

  2. Leifoet 1 Reputation point
    2022-09-26T22:00:29.32+00:00

    Thanks for answer AgaveJoe
    You wrote: "Yes, you must write code."
    I assume this is about the code to return to the initial program A (ie after the execution of the redirect URL = program B) ?

    How is that (back) code formulated?
    (I know METHOD="POST" but the relationship to Response.Redirect (URL) is unknown to me)

    Thanks for tips.
    Leifoet


  3. Leifoet 1 Reputation point
    2022-09-27T13:13:07.17+00:00

    @Lan Huang-MSFT
    I want to implement Response.Redirect in Classic ASP.

    This is the code in the main programA : Response.Redirect "URL subprogramB"

    My problem is :

    1. with which (ASP Classic)code does the application return from subB to A ?
    2. where should that code be inserted : I suspect in subB ?

    Thanks,
    Leifoet

    0 comments No comments