views:

46

answers:

2

Hi,

Is it possible to pass control and data from one web application to another?

The background is we have a web application 1 that we support and the client wants another web applications (2) functionality within this one.

The relationship betweenn web app 1 and web app 2 is that web app1 produces the csv file that web app 2 consumes and processes.

I want to know if it's possible to simply drive web app 2 through web 1 and keep them in their seperate projects without having to integrate web app 2 into web app 1 (which will require web app 1 to go through integration testing again...)?

Many Thanks,

edit---------------------

i should mention both web applications are on the same server.....

+1  A: 

You could simply redirect the client to a url in the other web app, passing any data on the query string. If they live on the same server, they could easily access the same file and db resources. Maintaining state between the 2 apps might be a problem.

Jason
Thanks Jason, is it possible to do by passing the data through a post instead through the querystring, as their could likely be a large list of parameters being passed...?
nav
Yes, you could also do it via a POST.
Jason
http://www.netomatix.com/httppostdata.aspx this looks like the way to go..
nav
+1  A: 

Sounds like a job for web services to let you expose the csv creation functionality from one application to another, or even use WCF if you want to use the new framework features.

<%@ WebService Language="C#" Class="Util" %> using System.Web.Services; using System;

[WebService(Namespace="http://www.contoso.com/")]
public class Util: WebService 
{
    [ WebMethod]
    public string GenerateCSV() 
    {
        //code to generate csv here
    }
}

http://msdn.microsoft.com/en-us/library/ba0z6a33(v=VS.80).aspx

Obv you would want to take care of authentication and authorisation too.

hearn
i should mention both web applications are on the same server
nav
You can still call a WS on the same server...
hearn