Connection between two separate ASP.Net Application

G

Guest

Hi,

Please help me to connect two ASP.Net applications. One is an online store,
based on Commerce Server 2002, the other is a database editing application.
Both are ASP.Net 1.1, VB applications.

In detail:
Technolgies: SQL2000, VS2003, .Net Framework 1.1, ASP.Net, VB, Commerce
Server 2002
From a Commerce Server 2002 online store (Retail 2002 Starter Site), I would
like to access an other application, which is a data handling ASP.Net
application. My goal is to call an AddDATAPage in the other applicatin, from
the online store, when the user clicks the Purchase button. Before the online
store's code of handling the purchase runs, I want to add a record to a table
with the other application's page, and when it is done, return to the code of
the online store's purchase button, to go on with the process of the purchase.

Thi is what I have tried so far:
In the online store's purchasing page's, Page_Load:
If HttpContext.Current.Items("IsOrderFormFilled") = True Then
Me.PurchaseBtn_Clicked(Nothing, Nothing)
Else
HttpContext.Current.Items.Add("IsOrderFormFilled", False)
End If

In the online store's purchasing page's, PurchaseBtn_Clicked:
If HttpContext.Current.Items("IsOrderFormFilled") = False Then
HttpContext.Current.Items("CheckoutUrl") =
HttpContext.Current.Request.Url.ToString
Response.Redirect("http://localhost/MMCS/CHAIN/AddCHAINPage.aspx")
Response.End()
End If

In the other application's page, after inserting the data to the database:
HttpContext.Current.Items("IsOrderFormFilled") = True
And I redirect back to the online store's purchaseing (Checkout) page.

But it doesn't work. The HttpContext.Current.Items("IsOrderFormFilled") is
always Nothing.

How can I send data between the applications? (e.g. the Product from the
online store, or the success of filling the data on the other application)
And how can I swich from one application to another, and back again, without
loosing the values like logged in user, pruducts in the basket, etc.?

Thanks for your help,

Attila
 
J

John Timney \( MVP \)

You need to treat them as entirely seperate applications, because thats what
they are.

I would suggest that the best way to tansfer values between them is to pass
the data using some form of web request to the AddDATAPage as part of the
click event you mention below - via a simple webservice call, or via a
webrequest get or post and return your IsOrderFormFilled value.

http://msdn.microsoft.com/library/d...f/html/frlrfsystemnetwebrequestclasstopic.asp

Regards

John Timney
Microsoft MVP
 
D

Daniel Fisher\(lennybacon\)

Web Services would solve your needs here.

Daniel Fisher(lennybacon) | Software Engineer | newtelligenceR AG
blog: http://staff.newtelligence.net/danielf
usergroup: http://vfl-niederrhein.net


-----Original Message-----
From: Attila Forczek [mailto:[email protected]]
Posted At: Thursday, February 23, 2006 2:25 PM
Posted To: microsoft.public.dotnet.framework.aspnet
Conversation: Connection between two separate ASP.Net Application
Subject: Connection between two separate ASP.Net Application

Hi,

Please help me to connect two ASP.Net applications. One is an online
store,
based on Commerce Server 2002, the other is a database editing
application.
Both are ASP.Net 1.1, VB applications.

In detail:
Technolgies: SQL2000, VS2003, .Net Framework 1.1, ASP.Net, VB, Commerce
Server 2002
From a Commerce Server 2002 online store (Retail 2002 Starter Site), I
would
like to access an other application, which is a data handling ASP.Net
application. My goal is to call an AddDATAPage in the other applicatin,
from
the online store, when the user clicks the Purchase button. Before the
online
store's code of handling the purchase runs, I want to add a record to a
table
with the other application's page, and when it is done, return to the
code of
the online store's purchase button, to go on with the process of the
purchase.

Thi is what I have tried so far:
In the online store's purchasing page's, Page_Load:
If HttpContext.Current.Items("IsOrderFormFilled") = True Then
Me.PurchaseBtn_Clicked(Nothing, Nothing)
Else
HttpContext.Current.Items.Add("IsOrderFormFilled", False)
End If

In the online store's purchasing page's, PurchaseBtn_Clicked:
If HttpContext.Current.Items("IsOrderFormFilled") = False Then
HttpContext.Current.Items("CheckoutUrl") =
HttpContext.Current.Request.Url.ToString
Response.Redirect("http://localhost/MMCS/CHAIN/AddCHAINPage.aspx")
Response.End()
End If

In the other application's page, after inserting the data to the
database:
HttpContext.Current.Items("IsOrderFormFilled") = True
And I redirect back to the online store's purchaseing (Checkout) page.

But it doesn't work. The HttpContext.Current.Items("IsOrderFormFilled")
is
always Nothing.

How can I send data between the applications? (e.g. the Product from the

online store, or the success of filling the data on the other
application)
And how can I swich from one application to another, and back again,
without
loosing the values like logged in user, pruducts in the basket, etc.?

Thanks for your help,

Attila
 
G

Guest

webrequest get or post and return your IsOrderFormFilled value.
I would prefer using post for that, to have it not visible in the url, an
dhave it SSL encripted.
But I don't know, how can I do it programatically. So from the VB code, how
can I redirect to an URL, and posting variables data with it?
Could you help me out with a simple example, instead of this pseudo code?
IsOrderFormFilled As Boolean
Url as String
Redirect(Url, Parameter:IsOrderFormFilled, SendingMethod:pOST)

Thanks,
Attila
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,108
Latest member
AlbertEste
Top