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 ap开发者_如何学Gop 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.....
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.
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.
精彩评论