RE: Run code between Intranet and Internet servers

From: Steven Cheng[MSFT] (v-schang_at_online.microsoft.com)
Date: 03/16/04


Date: Tue, 16 Mar 2004 07:02:45 GMT

Hi Brain,

>From your description, you have two web apps on two different server(one
intranet and other internet). In one intranet page, you'd like to redirect
to another page on the internet server , after some certain operations
,then redirect back to the intranet page and continue to execute some
following code, yes?
If there is anything I misunderstood, please feel free to let me know.

As for this quesiton, here are my suggestions:
1. As for your situation, the two pages are in different application, we
can only use Response.Redirect to forward between them. The server.Transfer
or server.Execute are all restricted to forward between pages in the same
web application.

2.The Response.Redirect method will started a new request (ended the
current one) with the new specified url. This is executed whenever the
Redirect is called , no matter the codebehind function has finished or not.
In fact, the request and the serverside codebehind code's execution will be
asynthronous after calling the Response.Redirect. That's impossbile to
waitting for the internet page redirect back and continute to execute from
the nextline code in the intranet page's codebehind code, do you think so?

3. If you do want to forward to the internet page and redirect back to the
intranet page to continue some following work, I think you may try the
following approach:

In the intranet page, you still can use Response.Redirect to redirect to
the internet page, and after the internet page finished operations redirect
back to the intranet page, however, you need to add some querystring in the
certain redirect url. For example:

#in internet page after operations finished:
Response.Redirect("http://intranetserver/intranet_page.aspx?state=return");

Then in the intranet page's Page_Load event, you can retrieve the certain
querystring and determine what to do according to the "state" querystring
's value, for example:

private void Page_Load(object sender, System.EventArgs e)
{
        if(Request.QueryString["state"] != null)
        {
                if(Request.QueryString["state"] == "return")
                {
                        //code to continue the work
                }
        }
}

Also, you can add other querystring to contain some other state info values
to indicate how to continue work in the original page. Hope this helps.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx



Relevant Pages

  • Re: ASP page to open/download a file
    ... On a W2K Advanced Server SP 4, redirecting to a local file works. ... So, hmm, I guess IE will redirect to a local file ... >> if done so from the intranet zone but not from the Internet zone! ...
    (microsoft.public.inetserver.asp.general)
  • Response.Redirect and Apache Forward
    ... intranet we can access this application like this: ... Now we want to make this application available on the Internet. ... For example if we want to redirect to index2.aspx (using ... error code because the we are redirected to: ...
    (microsoft.public.dotnet.framework.aspnet)
  • Windows Authentication and Anonymous login URGENT
    ... application that runs in my intranet. ... or through the internet ... where the login pop up box asks for their username and ... page it needs to redirect them to a different ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • =?iso-8859-1?q?[Solved]_Sicherheitsmeldung_beim_=F6ffnen_von_z=2EB=2E_Zip-Dateien_auf_ei
    ... Windows XP Pro Sp1 / IE7. ... Ich finde das sowas von irritierend (Internet Explorer? ... Intranet will. ...
    (microsoft.public.de.german.windowsxp.sonstiges)
  • Re: .NET apps not being recognized as being in the Intranet Zone
    ... that the network share is on to the "Intranet Sites" list. ... belongs to the IntRAnet zone, not the IntERnet zone. ... So, my .Net 2.0 program, to get to run from a network share, required ...
    (microsoft.public.dotnet.languages.csharp)